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.
John K. (Guest)
on 2006-02-12 02: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 K.
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
Craig W. (Guest)
on 2006-02-12 02:17
(Received via mailing list)
On Sat, 2006-02-11 at 19:05 -0500, John K. 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
John K. (Guest)
on 2006-02-12 02: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 W. wrote:

> http://rails.rubyonrails.org/classes/ActionView/He...
>
> Craig
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails


John K.
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
Pat M. (Guest)
on 2006-02-12 02:29
(Received via mailing list)
link_to 'fake url', :action => 'fake_action', :id => 5, :user_id => 7
John K. (Guest)
on 2006-02-12 02: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 M. wrote:

>> Stupid question I know... but I can't find the answer.
>>
>> _______________________________________________
>> Rails mailing list
>> removed_email_address@domain.invalid
>> http://lists.rubyonrails.org/mailman/listinfo/rails
>>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails


John K.
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
Pat M. (Guest)
on 2006-02-12 02: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.