ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Ajax on Rails
Subject:   access from controller for :searchtext
Date:   2005-06-29 21:43:10
From:   vcosby
Response to: access from controller for :searchtext

Thanks for your help, but I'm still getting nil for the param value.


Here's the code. Even tried adding a form tag around it, but no luck.


index.rhtml:

<form action="/demo" method="get">
<label for="searchtext">Live Search:</label>
<%= text_field_tag :searchtext %>
</form>
<%= observe_field(:searchtext,
:frequency => 1,
:url => { :controller => "demo",
:action => :live_search },
:update => "search_hits") -%>

Search Results:


<div id="search_hits"></div>


demo_controller.rb

def live_search
render_text @params[:searchtext]
end


1 to 1 of 1
  1. access from controller for :searchtext
    2005-06-29 22:14:32  vcosby [View]

    • access from controller for :searchtext
      2005-10-10 11:11:52  mewren.com [View]

      • access from controller for :searchtext
        2005-12-09 12:21:43  kevinmarshall [View]

1 to 1 of 1