KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I wasn't able to find anything here or elsewhere that covered both restricting a resource's routes and adding additional non-RESTful routes in Rails 3. It's probably very simple but every example or explanation I've come across addresses just one case not both at the same time. Here's an example of what I've been doing in Rails 2: map.resources :sessions, :only => [:new, :create, :destroy], :member => {:recovery => :get} Pretty straightforward, we only want 3 of the 7 RESTful routes because the others don't make any sense for this resource, but we also want to add another route which is used in account recovery. Now from what I gather doing either one of these things is very straightforward as well: resources :sessions, :only => [:new, :create, :destroy] Just like in Rails 2. And: resources :sessions do member do get :recovery end end So, how do I combine these two? Can I still use the old Rails 2 way of doing this? Is there a preferred way of doing this in Rails 3?
Tags (comma-separated)
Save Edits
Cancel