Step 1 of 6 | Menu

Resourceful routing with Rails


Resource routing in Rails is most often used for nesting related ActiveRecord objects, such as a post having many comments: The resource method of the router hooks up the "RESTful" urls with a set of standard set of controller methods and HTTP verb: post_comments GET /posts/:post_id/comments(.:format) {:action=>"index", :controller=>"comments"} POST /posts/:post_id/comments(.:format)

Visit Jamesalmond


Log in or Sign up to comment