I have spent a fair amount of time searching to find information on how one would pass arguments to an action (presumably some sort of URL appendage). It would seem to me that that would be something that would be done quite frequently. Judging from the extremely small amount of information that I recovered, I think that I again must be bucking the Rails way of doing things. So, the question is: If passing arguments to an action is something that is frequently done in Rails, how does one do it? It that isn''t the case because I am missing something, could someone please clue me in on what I''m missing. Thanks for any input. ... doug --~--~---------~--~----~------------~-------~--~----~ 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 spent a fair amount of time searching to find information on > how one would pass arguments to an action (presumably some sort of URL > appendage). It would seem to me that that would be something that > would be done quite frequently. Judging from the extremely smallYou can do <%= link_to "Pass some arguments",:controller=>"mycontroller",:action=>"myaction",:id=>35,:colour=>"green",:flavour=>"orange" %> This will use config/routes.rb to figure out how to structure the actual URL. If you haven''t customised it, you''ll get /controller/ myaction/35?colour=green&flavour=orange. Gwyn. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Maybe you could integrate a small solution on how to use those arguments later on? On Mar 4, 9:47 pm, "Gwyn Morfey" <gwy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have spent a fair amount of time searching to find information on > > how one would pass arguments to an action (presumably some sort of URL > > appendage). It would seem to me that that would be something that > > would be done quite frequently. Judging from the extremely small > > You can do <%= link_to "Pass some > arguments",:controller=>"mycontroller",:action=>"myaction",:id=>35,:colour=>"green",:flavour=>"orange" > %> > > This will use config/routes.rb to figure out how to structure the > actual URL. If you haven''t customised it, you''ll get /controller/ > myaction/35?colour=green&flavour=orange. > > Gwyn.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> Maybe you could integrate a small solution on how to use those > arguments later on?Sorry, I should''ve mentioned - the values will be accessible in the ''params'' hash: params[:id] == 35 params[:colour] == "green" params[:flavour] == "orange" Gwyn. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---