Can you explain me what these lines of code do ?
resources :posts, :pages do
post 'preview', :on => :collection
end
resources :undo_items do
post 'undo', :on => :member
end
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
will create standard/default RESTful routes for posts and pages (
GETPOST/posts,GETPUTDESTROY/posts/1,GET/pages/1/edit and etc).will add additional route for collection.
POST/posts/preview. if it said:on => :memberthan route would be for a member and would look like thisPOST/posts/1/preview.That’s a quick guide so you can get your head around. But as Robert K suggested, I also highly recommend going over rails guides. They are very well written and easy to understand.