Been a while since I programmed in Ruby and Rails and some of the basic concepts I just loose so quickly. This one I can''t find any examples of. I want to pass two pieces of information in my URL. The :id plus I want to pass my user_id. How do I pass it using the link_to? Stupid question I know... but I can''t find the answer. John Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
On Sat, 2006-02-11 at 19:05 -0500, John Kopanas wrote:> Been a while since I programmed in Ruby and Rails and some of the > basic concepts I just loose so quickly. This one I can''t find any > examples of. > > I want to pass two pieces of information in my URL. The :id plus I > want to pass my user_id. How do I pass it using the link_to? > > Stupid question I know... but I can''t find the answer.---- http://rails.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html Craig
Thanks, I have tried there, I personally could not find anything there, I was wondering if someone had an example I can work from? On 11-Feb-06, at 7:17 PM, Craig White wrote:> On Sat, 2006-02-11 at 19:05 -0500, John Kopanas wrote: >> Been a while since I programmed in Ruby and Rails and some of the >> basic concepts I just loose so quickly. This one I can''t find any >> examples of. >> >> I want to pass two pieces of information in my URL. The :id plus I >> want to pass my user_id. How do I pass it using the link_to? >> >> Stupid question I know... but I can''t find the answer. > ---- > http://rails.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html > > Craig > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsJohn Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
link_to ''fake url'', :action => ''fake_action'', :id => 5, :user_id => 7 On 2/11/06, John Kopanas <john@protoseinc.com> wrote:> Been a while since I programmed in Ruby and Rails and some of the > basic concepts I just loose so quickly. This one I can''t find any > examples of. > > I want to pass two pieces of information in my URL. The :id plus I > want to pass my user_id. How do I pass it using the link_to? > > Stupid question I know... but I can''t find the answer. > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Thanks Pat. Is there a way to get it so that the URL appears like: http://www.something.com/controller/fake_action/5/user_id/7 instead of: http://www.something.com/controller/fake_action/5?user_id=7 Thanks! :-) On 11-Feb-06, at 7:29 PM, Pat Maddox wrote:> link_to ''fake url'', :action => ''fake_action'', :id => 5, :user_id => 7 > > On 2/11/06, John Kopanas <john@protoseinc.com> wrote: >> Been a while since I programmed in Ruby and Rails and some of the >> basic concepts I just loose so quickly. This one I can''t find any >> examples of. >> >> I want to pass two pieces of information in my URL. The :id plus I >> want to pass my user_id. How do I pass it using the link_to? >> >> Stupid question I know... but I can''t find the answer. >> >> John Kopanas >> http://www.kopanas.com >> >> >> ====================================================================>> http://www.soen.info - source of the freshest software engineering >> information on the net >> http://cusec.soen.info - software engineering conference >> >> >> _______________________________________________ >> Rails mailing list >> Rails@lists.rubyonrails.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/railsJohn Kopanas http://www.kopanas.com ====================================================================http://www.soen.info - source of the freshest software engineering information on the net http://cusec.soen.info - software engineering conference
In your routes.rb file put: map.connect '':controller/:action/:id/user_id/:user_id'' On 2/11/06, John Kopanas <john@protoseinc.com> wrote:> Thanks Pat. Is there a way to get it so that the URL appears like: > > http://www.something.com/controller/fake_action/5/user_id/7 > > instead of: > > http://www.something.com/controller/fake_action/5?user_id=7 > > Thanks! :-) > > On 11-Feb-06, at 7:29 PM, Pat Maddox wrote: > > > link_to ''fake url'', :action => ''fake_action'', :id => 5, :user_id => 7 > > > > On 2/11/06, John Kopanas <john@protoseinc.com> wrote: > >> Been a while since I programmed in Ruby and Rails and some of the > >> basic concepts I just loose so quickly. This one I can''t find any > >> examples of. > >> > >> I want to pass two pieces of information in my URL. The :id plus I > >> want to pass my user_id. How do I pass it using the link_to? > >> > >> Stupid question I know... but I can''t find the answer. > >> > >> John Kopanas > >> http://www.kopanas.com > >> > >> > >> ====================================================================> >> http://www.soen.info - source of the freshest software engineering > >> information on the net > >> http://cusec.soen.info - software engineering conference > >> > >> > >> _______________________________________________ > >> Rails mailing list > >> Rails@lists.rubyonrails.org > >> http://lists.rubyonrails.org/mailman/listinfo/rails > >> > > _______________________________________________ > > Rails mailing list > > Rails@lists.rubyonrails.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > John Kopanas > http://www.kopanas.com > > > ====================================================================> http://www.soen.info - source of the freshest software engineering > information on the net > http://cusec.soen.info - software engineering conference > > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >