Passing multiple parameter through observe_field

Hi!

Im trying to search through multiple parameters through observe_field.

Following is my code.: its not showing any result, kindly help…

Filter on Device Name :

Filter on platform :

<%= image_tag(“spinner.gif”,
:align => “absmiddle”,
:border => 0,
:id => “spinner”,
:style =>“display: none;” ) %>

<%= observe_field ‘search’, :frequency => 2,
:update => ‘table’,
:before => “Element.show(‘spinner’)”,
:success => “Element.hide(‘spinner’)”,
:url => {:action => ‘trackLocation’},
:with => “‘search=’+ escape($(‘search’).value) + ‘&search1=’ +
escape(value)”%>

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

and controller looks like:

def trackLocation
@labs=Labt.find(:all)
conditions = [“name LIKE ?”, “%#{params[:query]}%”] unless
params[:query].nil?

@devices=Dev.find(:all,:conditions=>[“name LIKE ? and platform LIKE ?”,
“%#{params[:search]}%”,“%#{params[:search1]}%”]).paginate
:per_page=>5,:page=>params[:page]

#devs_per_page=5
#@devs_pages, @devs = paginate :devs, :conditions => conditions,
:per_page
=> devs_per_page

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

end

View this message in context:
http://www.nabble.com/passing-multiple-parameter-through-observe_field-tp17978823p17978823.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

Supriya A. wrote:

Hi!

Im trying to search through multiple parameters through observe_field.

Following is my code.: its not showing any result, kindly help…

Filter on Device Name :

Filter on platform :

<%= image_tag(“spinner.gif”,
:align => “absmiddle”,
:border => 0,
:id => “spinner”,
:style =>“display: none;” ) %>

<%= observe_field ‘search’, :frequency => 2,
:update => ‘table’,
:before => “Element.show(‘spinner’)”,
:success => “Element.hide(‘spinner’)”,
:url => {:action => ‘trackLocation’},
:with => “‘search=’+ escape($(‘search’).value) + ‘&search1=’ +
escape(value)”%>

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

and controller looks like:

def trackLocation
@labs=Labt.find(:all)
conditions = [“name LIKE ?”, “%#{params[:query]}%”] unless
params[:query].nil?

@devices=Dev.find(:all,:conditions=>[“name LIKE ? and platform LIKE ?”,
“%#{params[:search]}%”,“%#{params[:search1]}%”]).paginate
:per_page=>5,:page=>params[:page]

#devs_per_page=5
#@devs_pages, @devs = paginate :devs, :conditions => conditions,
:per_page
=> devs_per_page

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

end

View this message in context:
http://www.nabble.com/passing-multiple-parameter-through-observe_field-tp17978823p17978823.html
Sent from the RubyOnRails Users mailing list archive at Nabble.com.

Hi…

try the following…

<%= observe_field ‘search’, :frequency => 2,
:update => ‘table’,
:before => “Element.show(‘spinner’)”,
:success => “Element.hide(‘spinner’)”,
:url => {:action => ‘trackLocation’},
:with => “‘search=’+ escape($(‘search’).value) + ‘&’ +
‘search1=’+
escape(value)”%>

This also dint helped… basically i want to search through both the
parameters . …

On Wed, Jun 18, 2008 at 3:11 PM, Suneeta Km <

Supriya A. wrote:

This also dint helped… basically i want to search through both the
parameters . …

On Wed, Jun 18, 2008 at 3:11 PM, Suneeta Km <

You can pass the value of the element you are observing. what do u mean
by escape(value)?