RailsCasts Pro episodes are now free!

Learn more or hide this

Zac Clancy's Profile

GitHub User: zclancy

Comments by Zac Clancy


To remedy this issue, I added two more routes, just after the one added in the tutorial to handle the 'PUT' and 'DELETE' options for update and destroy. I've only played around with it for a little while, but I haven't seen any issues. This is how my routes for the pages look:

root to: "pages#index"
get ':id', to: 'pages#show', as: :page
put ':id', to: 'pages#update', as: :page
delete ':id', to: 'pages#destroy', as: :page

EDIT: Just for further clarification, the paths to edit, would be http://<yourapp>/pages/<page>/edit, rather than http://<yourapp>/<page>/edit. I haven't worked around that yet, but haven't really tried either.