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.
9f4a65c520a69cd357d830661e172272?d=identicon&s=25 JannaB (Guest)
on 2009-06-02 03: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
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2009-06-02 04: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.