Additional RESTful actions

suggest change
resources :photos domember doget 'preview'endcollection doget 'dashboard'endend

This creates the following routes in addition to default 7 RESTful routes:

get       '/photos/:id/preview',          to: 'photos#preview'
get       '/photos/dashboards',           to: 'photos#dashboard'

If you want to do this for single lines, you can use:

resources :photos doget 'preview',   on: :memberget 'dashboard', on: :collectionend

You can also add an action to the /new path:

resources :photos doget 'preview', on: :newend

Which will create:

get       '/photos/new/preview',          to: 'photos#preview'

Be mindful when adding actions to your RESTful routes, probably you are missing another resource!

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Routing:
*Additional RESTful actions

Table Of Contents
1Routing
55CSV