I have problems using ajax in a search field. In view/layouts I have main.html.erb with code:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it"> <head> <title>Consegna sacchetti</title> <%= stylesheet_link_tag 'scaffold' %> <%= javascript_include_tag :defaults %>
..............
in application.controller I have put layout "main".
under view/sacchetti I have index.html.erb for sacchetti_controller:
<div class="searchEmployeeForm_adv"> <% form_tag'javascript:void(0)' do %> <p> <%= label_tag :search, 'Nominativo:' %> <%= text_field_tag :search, params[:search] %> <%= image_tag("indicator.gif", :id => "spinner", :style => "display: none;") %> </p> <% end %> <%= observe_field(:search, :frequency => 0.5, :update => :search_hits, :loading => "Element.show('spinner')", :complete => "Element.hide('spinner')", :url => {:action => :list, :method => :get}, :with => "'search=' + escape(value)")%> </div> <div id="search_hits"> <%= render :partial=>'rusers_list' %> </div>
observe_files seems don't work, with firebug I see no ajax requests. What I've missed?
p.s. sorry for my bad english