I have a simple search form that looks something like this:
app / views / search / index.html.erb
<%= form_for @search, :as => :search, :remote => true, :url => {:action => "query"}, :html => {:id => 'search-form'} do |f| %> ... <% end % <div id="search-results"></div>
* application / controllers / search_controller.rb *
def index @search = SearchCriteria.new end def query @search = SearchCriteria.new(params[:search])
Then I have a js.erb template: * Application / views / search / _query.js.erb *
$('#search-results').update("<%= escape_javascript(render(@summaries)) %>");
However, I donβt see anything fit in the "search-results" div. Do I need some template to render "@summaries"? If so, what would it be called and where would I place it (i.e. App / views / search?) (I use jquery and rails 3)
Thanks.
source share