Help please with observe_form - not working

My observe_form is basically totally limp. I think it should update
without
hitting submit button but even if I hit it , it doesn’t change (doesn’t
seem
to post the data).
Can anyone please take a look and see if I"m doing something wrong. TIA

Form:
<% start_form_tag({:action => “livesearch”},
:id => “asearch”) %>

Category <%= options_from_collection_for_select @categories, :id, :name %> State <%= options_from_collection_for_select @states, :id, :name %> Terms <%= options_from_collection_for_select @terms, :id, :name %> Title

enter in as many titles as you wish seperated by a comman

<%= text_field("title", @params['title'], :size => 10) %> City

enter in as many cities as you wish seperated by a comman

<%= text_field("city", @params['city'], :size => 10) %>

<%= submit_tag ‘livesearch’ %>
<% end_form_tag %>

<%= observe_form “asearch”,
:frequency => 1,
:update => “table”,
:with => “Form.serialize(asearch)”,
:complete => “Element.show(‘table’)”,
:url => { :action => “livesearch” } %>

<%= render :partial => "positions_list" %>

Controller:

def livesearch
@categories = Category.find(:all, :order => “name”)
@states = State.find(:all, :order => “name”)
@terms = Term.find(:all, :order => “name”)

params[:cat]
params[:stat]
params[:term]
params[:city]
params[:title]

pq = Position.query # the syntax is because I"m using a plugin
CriteriaQuery, a find wrapper.
pq.category_id_in(params[:cat]) if params[:cat]
pq.state_id_in(params[:stat]) if params[:stat]
pq.term_id_in(params[:term]) if params[:term]
pq.city_in(params[:city].split(’,’)) if params[:city]
pq.title_in(params[:title].split(’,’)) if params[:title]
@positions = pq.find

if request.xml_http_request?
render :partial => “positions_list”, :layout => false
end
end
end


On 10/11/06, Dark A. [email protected] wrote:

Category <%= comman :complete => "Element.show('table')", def livesearch pq = Position.query # the syntax is because I"m using a plugin end end end

Here is the script it’s producing from the page source:


No one ? Alright let me ask this then - when using observe_form does
each
element have to have it’s own id and name ?

Stuart

On 10/11/06, Dark A. [email protected] wrote:

<% start_form_tag({:action => “livesearch”},
%>

              :frequency => 1,

params[:city]


http://en.wikipedia.org/wiki/Dark_ambient


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs