Forum: Ruby on Rails pass a varible from view to controller

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.
Ishara G. (Guest)
on 2009-02-23 12:21
(Received via mailing list)
please can anyone suggest me a code to pass a variable whichis in the
view
to controller
Priya B. (Guest)
on 2009-02-23 12:37
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.
Conrad T. (Guest)
on 2009-02-23 13:44
(Received via mailing list)
On Mon, Feb 23, 2009 at 2:37 AM, Priya B. <
removed_email_address@domain.invalid> 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
MaD (Guest)
on 2009-02-23 14:27
(Received via mailing list)
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
shahroon ali (Guest)
on 2009-02-23 14:41
(Received via mailing list)
Yes
This topic is locked and can not be replied to.