Forum: Ruby on Rails REST Routing issue

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Kad K. (Guest)
on 2007-06-12 14:14
If I use
I can create a new message ressource for user 25 that's OK....

I would like to be able to use such url :;send?to=5

in order to create a new message from user 25  for a specific receiver

how should write my route ?  I tried....

  map.resources :users do |users|
    users.resources :messages, :member => { :send => :get }

but I got an error

no route found to match "/users/25/messages;send" with {:method=>:get}


Rob B. (Guest)
on 2007-06-26 03:28
(Received via mailing list)
On Jun 12, 2007, at 6:14 AM, Kad K. wrote:
> kad
map.resources :users do |users|
     users.resources :messages, :new => { :send => :get }

And then, of course, it's up to you to provide the :to =>
in your send_new_message_path() helper:  send_new_message_path(:to =>
gives you:


   map.resources :users do |users|
     users.resources :messages, :collection => { :send => :get }

and then:  send_messages_path(:to => receiver)
gives you:



Rob B.
This topic is locked and can not be replied to.