Skip to content

Instantly share code, notes, and snippets.

@kareemgrant
Last active August 29, 2015 14:19
Show Gist options
  • Save kareemgrant/ed346e56d5b9948a7745 to your computer and use it in GitHub Desktop.
Save kareemgrant/ed346e56d5b9948a7745 to your computer and use it in GitHub Desktop.

Rails Forms

Goals

  1. Pull together everything you've learned about Rails thus far
  2. Explore the form generation possibilities using Rails!

Assignment

This homework assignment requires that you build upon your existing blog app (from the prior homework assignment)

  1. Add an Authors model to your blog app with the following fields: first name and last name

  2. Create an association between Authors and Posts where Authors can have many Posts

  3. Add the ability to create, read (list), update and delete Authors (similar to what was done for Posts)

  4. Update your app to allow users to associate an Author with a Post when both creating and editing new Posts - the form should have a select dropdown that allows users to choose an Author.

  5. Use a partial to ensure that the view code for your form isn't duplicated.

Recommended Activity

Checkout the Rails documentation on Form Helpers: http://guides.rubyonrails.org/form_helpers.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment