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.
Dcf093a36c8a7e286dbefe10454813e1?d=identicon&s=25 Ishara Gunathilake (Guest)
on 2009-02-23 11:21
(Received via mailing list)
please can anyone suggest me a code to pass a variable whichis in the
view
to controller
0348be81e22f24afdaa6e4f137aa9dfc?d=identicon&s=25 Priya Buvan (priyadharsini)
on 2009-02-23 11:37
Ishara Gunathilake 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.
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (conradwt)
on 2009-02-23 12:44
(Received via mailing list)
On Mon, Feb 23, 2009 at 2:37 AM, Priya Buvan <
rails-mailing-list@andreas-s.net> wrote:

>
> Ishara Gunathilake 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
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-23 13: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
5b6e58cabeba80bc6faf29b7f45aa622?d=identicon&s=25 shahroon ali (Guest)
on 2009-02-23 13:41
(Received via mailing list)
Yes
This topic is locked and can not be replied to.