If I use http://0.0.0.0:3000/users/25/messages/new
I can create a new message ressource for user 25 that''s OK....
I would like to be able to use such url :
http://0.0.0.0:3000/users/25/messages;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 }
end
but I got an error
no route found to match "/users/25/messages;send" with
{:method=>:get}
thanks
kad
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I have this standard url path
:url => {:action => ''list'', :params =>
params.merge({:page => n})},
how can I change it to a REST path, I mean how can I merge the params
???
:url => projects_url ???
thanks for your help
kad
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
projects_url(:page => n) On Jun 13, 9:59 am, Kad Kerforn <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have this standard url path > > :url => {:action => ''list'', :params => params.merge({:page => n})}, > > how can I change it to a REST path, I mean how can I merge the params > ??? > > :url => projects_url ??? > > thanks for your help > > kad > > -- > Posted viahttp://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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Jun 12, 2007, at 6:14 AM, Kad Kerforn wrote:> If I use http://0.0.0.0:3000/users/25/messages/new > I can create a new message ressource for user 25 that''s OK.... > > I would like to be able to use such url : > > http://0.0.0.0:3000/users/25/messages;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 } > end > > but I got an error > > no route found to match "/users/25/messages;send" with {:method=>:get} > > thanks > > kadmap.resources :users do |users| users.resources :messages, :new => { :send => :get } end And then, of course, it''s up to you to provide the :to => receiver.id in your send_new_message_path() helper: send_new_message_path(:to => receiver) gives you: /users/25/messages/new;send?to=5 OR: map.resources :users do |users| users.resources :messages, :collection => { :send => :get } end and then: send_messages_path(:to => receiver) gives you: /users/25/messages;send?to=5 -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---