Forum: Ruby on Rails Set a session variable in a link_to

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
JannaB (Guest)
on 2009-06-02 05:42
(Received via mailing list)
I need to link_to a particular method in a particular controller that
needs to do something one time, from one page, and something
dfifferent another time, from another page.

I intend to set and subsequently get a session variable to do this.
This would require setting a session variable in the link_to code --
is there a way to do this? Thanks, Janna
Freddy A. (Guest)
on 2009-06-02 06:44
(Received via mailing list)
link_to("my link", my_task_path, :special_needs => true)

That would give you params[:special_needs]

What are the actions maybe you should have different controllers?
This topic is locked and can not be replied to.