Rails: Menu Mixer
The hardest part of every project is settling on what overall theme I would like to use. For the rails project i landed on Menu Mixer, a web application that will allow you to view, add, and save recipes. This will be more dynamic than my Sinatra project and there’s a ton of inspiration in cooking.
Getting started.
I started by creating my database. I began to map out what tables would be needed and the types of relationships each table had. I also need a join table to access my recipes and ingredients together. I can create the table by typing rails g migrations NAME tablename
and as easy as that, my table is created!
Now, I start adding all the folders and files I need. these are my controllers, models, and views.
This was a bit daunting because i have much more files in each section than in my sinatra coupon project.
controllers
I have seven different controllers each important for storing the logic of my project.
Ingredients –
Recipes -
Users -
Sessions -
Menu -
Users_recipes-
Next I want to work on my routes
I need to make sure that I have some nested routes. Nested routes allow you to capture relationships in your routing. I decided to organize groups of controllers under resources. You might group a number of controllers. You can route to such a group by using a resources block. This was a big change from Sinatra and it is a lot cleaner, so much easier to see as it is all in one place, and a lot less to type out.
now I want to work on my views
views
recipes-
edit_recipe
index
new
search
Show
sessions-
destroy
new
static-
home
user-
new
signin
signup
user_menu
styling
I wanted Menu Mixer to look more eye appealing than my Sinatra project. I add a navigation bar with a search box feature. I also added pictures and layouts. My Home page showcases eye appealing recipes.
Although it’s not perfect I am pleased with how this looks, how user friendly it is, and how smoothly it runs. I can see how much I have learned in just a few weeks.