…for Better Code Separation

Image for post
Image for post

What is this Model, View, Controller (MVC) architectural pattern?

Source: Rails Documentation

The MVC architecture divides your code into three (3) layers Models, Views and Controllers separating the different responsibilities of the program.

MVC diagram from Wikipedia
MVC diagram from Wikipedia
Image from Wikipedia

Model Layer

This layer in Ruby on Rails contains the domain model, which generally represents a specific object class (e.g. a Person, Animal, Books). This is where the business logic is usually handled since this model is linked to the database and its data is derived from the relative table’s rows.

View Layer

Handles the visual representations of the responses provided by the controllers. Since the controller can return information as HTML, XML, JSON, etc.

Controller Layer

In Rails this layer is responsible for interacting with the model, manipulating its data and providing suitable responses to various HTTP requests. …

Social Media Website Demo: SpyBook
SpyBook: Github

Image for post
Image for post

According to the Odin Project: the goal of this exercise is to build some of the baseline features found in one of the more popular social media website applications, Facebook.

While following this article we will be putting together some of the core features of the platform — users, profiles, “friending”, posts, comments, news feed, and “liking”. We will also implement a sign-in feature by using the real Facebook through the use of gems such as ‘OmniAuth and ‘Devise’.

Table of Contents

  1. Entity Relationship Planning
    Users Table
    Friendships Table
    Posts Table
    Comments Table
    Likes Table

Hint to Understanding Proper Element Positioning

Hypertext Markup Language (HTML) & Cascading Style Sheets (CSS) are two of the internet’s most used programming languages, its greatest translators and presenters of information.

Image for post
Image for post
Image of HTML & CSS coding

Both languages used in unison to turn this image above into what seems a lot more familiar to the lot of us.

Image for post
Image for post
Image of a mock-up of ‘Microsoft.com’ dated: 9/20/2019

Getting started

Choosing an Integrated Development Environment (IDE)

First, you’re going to need an application that takes your typed text and provide various automated tasks. …


Aaron Rory

Full Stack Web Developer — Studying JavaScript, HTML, CSS, Node.js, SQL, Ruby and Rails as well as C# and Unity. @ARN GithubProfile: https://github.com/Aaron-RN

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store