DEV Community

RJasonClarke
RJasonClarke

Posted on

Flatiron Rails Project

Finally, Rails has been a section I've really been looking forward to since the start of the program and I can't believe I'm finally here. Sinatra was a great intro to CRUD but now I feel like I'm prepping to compete with the real deal web developers out there.

First day of learning Rails was filled with a lot of familiar concepts that were presented with Sinatra but simplified. Lots of things in Rails were generated with all of their required directories such as Controllers generating with views and even the database files became very simple to work with. Instant fan.

After learning how to generate a Rails project and my files I started working on my models and giving them the appropriate associations I would need for my project. The project I chose to work on was a simple data management project that I could relate to a past job. In this past job there was a lot of miscommunication or sometimes a lack of communication in general so I figured that a job board listing jobs and their details would be a great way for employees to get an idea of what their given task would entail.

For this app I would need a model for users, jobs, and tools. Users would need the ability to make a profile, post a job, and list tools needed for that particular job. To even start doing that I would have to make the User table within the database take in an email and a password. After that I would need to go to the model and require each user to has those specific attributes via validations before they could make a profile. Once everything was set for the user model I was able to move on to the job model and require each job to have a title and the option of a description. The way to do this would be to go into the job model and list the description as "optional: true" or simply put no limitation on adding a description. Lastly I had the tool model that simply needed a title since only the names were going to be listed under job as an index.

Next came the process of working on my controllers where all of my apps logic will be stored. It didn't take too long to adjust to writing the controllers simply because previous lessons had prepared me for any sort of ruby conundrum that I may encounter. It was all just a matter of learning rails conventions.

The last and least stressful part of the project had to be the views. The views were a majority html with embedded ruby. Very simple with lots of room to play around with different designs and make things a bit more organized with the frontend.

Top comments (0)