rails new
Added Ruby class to represent a picture.
Enhanced the Picture class with Rails superpowers -- but we still need a database table to back it up.
Created a file which will contain instructions on how to create a table in the database to store pictures (rails g migration CreatePictures).
Adding instructions to the migration file to create a table called pictures with two columns, source and caption.
Used rake db:migrate to execute the instructions in the migration file. The schema.rb file was automatically updated with the new database structure, but we don't ever modify schema.rb ourselves.
Now that we have a model backed up by an underlying database table, it's time to build a web interface for users to interact with it. We need to RCAV every interaction we want to support.
Made a route to support reading a list of all pictures.
Created a controller to handle picture-related requests.
Defined a method to handle the list of all pictures request.
Created a folder to hold all picture-related view templates, and a template to format the list of all pictures.
Prepared the data required to paint the list of all pictures.
Formatted the data for human consumption in the view template.
One down, six to go! Next up: made a route to support reading the details of one picture.
Defined a method to handle the details of one picture request.
Created a template to format the details of one picture.
Prepared the data required to paint the details of one picture.
Formatted the data for human consumption in the view template.
Next up: the user should be able to request a form to enter information for a new picture.
Defined a method to handle the form for a new picture request.