Pass a varible from view to controller

please can anyone suggest me a code to pass a variable whichis in the
view
to controller

Ishara G. wrote:

please can anyone suggest me a code to pass a variable whichis in the
view
to controller

Can you please provide the exact problem? So that can try for solution.

On Mon, Feb 23, 2009 at 2:37 AM, Priya B. <
[email protected]> wrote:

Ishara G. wrote:

please can anyone suggest me a code to pass a variable whichis in the
view
to controller

Can you please provide the exact problem? So that can try for solution.

Hi, I agree with Priya. What are you trying to do exactly? Please
provide
a use case or
scenario.

-Conrad

Yes

basically you got two possibilities:

  1. write the value into a session-variable
    session[:wtf] = “some string or value”

  2. pass your value as a parameter to some action and read params in
    your controller:
    view:
    <%= link_to “my_action” :controller => :bla, :action
    => :my_action, :wtf => “some string or value” %>
    controller:
    def my_action
    puts params[:wtf]
    end