Dee wrote:
> 
> I'd really like to have nested routes such as /people/1/purchases and /
> people/1/sales. So I'm kind of surprised I can't do this in Rails

You can do it with map.connect. You may have to play with the syntax, 
but I think this will work:

map.connect 'people/:person_id/:controller',
            :action => 'index',
            :person_id => /\d+/

That will make 'people/1/sales' the equivalent of 'sales?person_id=1'

You'll then need to update you index action in your sales controller, to 
detect params[:person_id] and use it to modify @sales. Or you can create 
a custom action to handle this.



-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to