I have a simple search form that looks something like this:
App / view / Search /index.html. ARB * AP / controller / search_controllerRB * Then I have a js.erb template: * app / view / search / _query.js.erb * However, I can not see anything in the 'search-results' div. Do I need some type of template to render "Sassamari"? If so, what will be its name and where will I put it (i.e. app / scene / search?) (I am using jquery and rail 3) thanks. You should rename your template file: Underscore is unnecessary & lt;% = form_for @search ,: as = & gt; : Search, Remote = & gt; True,: url = & gt; {: Action = & gt; "Query"},: html = & gt; {: Id = & gt; 'Search-form'}. F | & Gt%; ... & lt;% end% & lt; Div id = "search-results" & gt; & Lt; / Div & gt;
DIF index @ search = search criteria.new enddef query @ search = search certificate.New ( Param [: search]) # Otherwise, search ... @ cremation = do_search @ search response_to do format | Format.js end end
$ ( '# Search result'). Update ("& lt;% = escape_javascript (render (@shmijs))%>;);
app / View / search / _query.js.erb = & gt; * App / view / search / query.js.erb
Comments
Post a Comment