CRUDy Rails

Just a pile of gems...

I have entered the final stretch of DevBootCamp this past week. Having been exposed to Ruby and Sinatra, I felt comfortable understanding the architecture of Rails. The following is a walkthrough of my workflow in creating a new Rails application.

  1. bundle install
  2. Setup databases: touch config/database.yml and rake db:create
    • 3 types of databases:
    • development(local deploy)
    • test(for rspec and various test suites)
    • production(what is sent to the world. Should not include test suite)
  3. Make migrations Should be plural! rails g migration name_of_file
  4. Make corresponding models. Should be singular!
  5. Make routes in routes.rb
  6. Make controller#action and corresponding view plural controller file and view folder.
    • categories#index and view
    • categories#show and view
    • categories#edit comes from categories#show and view => categories#update
    • categories#destroy Comes from categories#show
    • categories#new and view => categories#create I did not create a link_to in any views for the 'categories/new' route and categories#new controller action.