Forum: Ruby on Rails Getting values

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.
Jeremy (Guest)
on 2006-06-07 10:19
What if I have this URL on my browser's address bar?

http://www.mysite.com/controller/rhtml/3

How can I put the "3" as a value inside the controller.

Thanks,

Jeremy
Jeremy (Guest)
on 2006-06-07 11:36
anyone knows the answer to my question???
scott (Guest)
on 2006-06-07 13:25
Jeremy wrote:
> anyone knows the answer to my question???

params[:id] should contain the value you need
Chris T (Guest)
on 2006-06-07 15:45
(Received via mailing list)
Jeremy wrote:
>
>
Not sure I'm understanding you correctly but if you have a URL

http://www.mysite.com/my_controller/some_action/3

Then the 3 is available in the action "some_action" in controller
"my_controller" by params[:id]

HTH
This topic is locked and can not be replied to.