Forum: Ruby on Rails Passing Multiple Values In URL

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-12 01:06
(Received via mailing list)
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
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-12 01:17
(Received via mailing list)
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/He...

Craig
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-12 01:24
(Received via mailing list)
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:

> http://rails.rubyonrails.org/classes/ActionView/He...
>
> Craig
>
> _______________________________________________
> 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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-02-12 01:29
(Received via mailing list)
link_to 'fake url', :action => 'fake_action', :id => 5, :user_id => 7
9904f8acaf66a3c1a4b4434676be11cf?d=identicon&s=25 John Kopanas (Guest)
on 2006-02-12 01:38
(Received via mailing list)
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:

>> Stupid question I know... but I can't find the answer.
>>
>> _______________________________________________
>> 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
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-02-12 01:45
(Received via mailing list)
In your routes.rb file put:

map.connect ':controller/:action/:id/user_id/:user_id'
This topic is locked and can not be replied to.