Restful routes question

Hi all,

This is something I puzzle for quite a while. I need just one more
controller method just like index, that doesn’t need another parameter
when used with redirect_to (not like show). For that I define in
config/routes:

map.resources :orders, :member => { :confirm => :get }

In my controller I can do then

redirect_to confirm_order_path(some_id), but I actually want

redirect_to confirm_order_path

Is there an easy way to do this?

Thanks in advance and Merry Xmas
Jens

What you’re after is :collection, not :member.

http://frozenplague.net/2008/01/restful-routing-an-overview/


Ryan B.
Freelancer
http://frozenplague.net

Ryan B. wrote:

What you’re after is :collection, not :member.

http://frozenplague.net/2008/01/restful-routing-an-overview/


Ryan B.
Freelancer
http://frozenplague.net

Thanks a lot Ryan, that was exactly what I needed.

Have a nice Xmas day
Jens

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs