DEV Community

Stacy Daniel
Stacy Daniel

Posted on

My First Ruby on Rails Project

Phew 😮💨

It has been a hell of a crazy month 🤣...yes a month. The initial two weeks to create the project plus the other two, to pass the review, but I finally did it 👏!

My third project here at Flatiron was required to build a Web App using the Ruby on Rails framework. I decided to create a parent forum website, open to current and soon to be parents in the surrounding neighborhoods of Brooklyn NY.

This forum has the customary signup/login/logout functionality, as well as a third party login authentication using a google.

There were many challenges with this project that ran from appropriately setting up my google omniauth, getting my delete button to work, but my biggest challenge by for was rendering the proper routes within my methods as well as within my forms.

My Skeleton App Setup

class User < ApplicationRecord

has_secure_password
has_many :posts 
has_many :comments, through: :posts

validates :username, :email, presence: true, uniqueness: true 
Enter fullscreen mode Exit fullscreen mode

class Post < ApplicationRecord

belongs_to :user
has_many :comments 
has_many :users, through: :comments

validates :title, :content, presence: true
Enter fullscreen mode Exit fullscreen mode

class Comment < ApplicationRecord

belongs_to :user
belongs_to :post

validates :content, presence: true 
Enter fullscreen mode Exit fullscreen mode

...

Overview

Once a user joins/signup and is logged in, they are directed to their homepage/profile, where they're able to create and then share a post.

Users can respond to a question or suggestion to any of the post shared, by responding with a comment.

Only the creator of the post can edit and or delete said post.

Conclusion

I honestly thought that phrase 3/rails project would have been the simplest, being that the labs were very self explanatory, but after weeks of mulling over errors after errors, I was finally able to get the web functionality I wanted!. I must admit it was a very close one, but having that drive and determination to succeed in becoming a Developer...kept me going!!
Happy Coding y'all!😁

Top comments (0)