In the old way, you can always pass params like this, right? <%= link_to "Whatever",:url => {:action => :new,param1 => :foobar} %> How would you do this Restfully? --~--~---------~--~----~------------~-------~--~----~ 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 Sun, Jun 22, 2008 at 2:03 PM, Mike C <snibble-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > In the old way, you can always pass params like this, right? > > <%= link_to "Whatever",:url => {:action => :new,param1 => :foobar} %> > > How would you do this Restfully?Mike, You can pass various parameters through the your restful routes. <%= link to( "create a new resource", resource_path( :id => resource, :extra_param => foo, :extra_param_2 => bar ) ) %> Something along those lines should work fine. Cheers, Robby -- Robby Russell Chief Evangelist, Partner PLANET ARGON, LLC design // development // hosting http://www.planetargon.com/ http://www.robbyonrails.com/ aim: planetargon +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s actually the way I first thought of, but it didn''t work it seems. Scrolling down in the error page reveals all the parameters passed, and the ones passed through the restful routes don''t show up. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Oh, I found out the reason it was reporting errors. I forgot that it was nested, so it needed 1 more parameter for the ID and then it accepted other params. Thanks! On Jun 22, 2:40 pm, Mike C <snib...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> That''s actually the way I first thought of, but it didn''t work it > seems. Scrolling down in the error page reveals all the parameters > passed, and the ones passed through the restful routes don''t show up.--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---