Hi, Is there a way to pass additional parameters to named REST routes so that they get appended to the URL? For example, if I have a post_url(@post), can I somehow tell Rails to append another parameter? /posts/23?extra_param=hello What I have been doing is use url_for instead: url_for(:action => ''show'', :id => @post, :extra_param => ''hello'') But that''s long! Ingo -- 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 -~----------~----~----~----~------~----~------~--~---
Ingo Weiss wrote:> Hi, > > Is there a way to pass additional parameters to named REST routes so > that they get appended to the URL? For example, if I have a > post_url(@post), can I somehow tell Rails to append another parameter? > > /posts/23?extra_param=hello > > What I have been doing is use url_for instead: > > url_for(:action => ''show'', :id => @post, :extra_param => ''hello'') > > But that''s long! > > Ingoif its something specific add a second route on top of the existing one and make the new field required that way if the smaller route is requested it will skip over the new one. however if the required parameter is attached the router will stop at the correct routing address. -- 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 -~----------~----~----~----~------~----~------~--~---