Home
Ruby on Rails
Cheatsheets
When standard routes are used in a RESTful context, Rails will reflect upon the object passed to it and automatically build a form with the relevant RESTful URL depending on whether the form is wrapping a new record (create) or an existing record (update). Nested routes will require you to be more verbose. Standard routes
|
Standard routes |
new record? |
method |
URL |
|
|
yes |
POST |
|
|
|
no |
PUT |
|
|
Nested routes |
new record? |
method |
URL |
|
|
yes |
POST |
|
|
|
no |
PUT |
|
Sometimes you want to quickly see the output of helper methods, and constantly clicking refresh in your browser then viewing the page source can be tiresome. Instead, use the Rails console to check helpers are doing what you want them to.
More