Skip to content

Instantly share code, notes, and snippets.

@nmcolome
Last active May 16, 2017 15:51
Show Gist options
  • Save nmcolome/d294eee89d9e5b77312d19e24598759d to your computer and use it in GitHub Desktop.
Save nmcolome/d294eee89d9e5b77312d19e24598759d to your computer and use it in GitHub Desktop.
routes_helpers_check_nc

Check for Understanding

  • What terminal command will return information about your routes?

rake routes

  • What 5 pieces of info will rake routes give you?

(1)the prefix, (2)verb, (3)uri pattern and (4)controll#action for each route; and a (5)list of all our routes.

  • Give an example of a link to a cats edit page named “Edit”

<%= link_to "Edit", edit_cat_path(cat) %>

  • Give an example of a link to a cats edit page named “Edit cat ‘Spunky’” or whatever the name of your cat is…

<%= link_to "Edit cat '#{cat.name}'", edit_cat_path(cat) %>

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