943,202 Members | Top Members by Rank

Ad:
  • Ruby Discussion Thread
  • Unsolved
  • Views: 22
  • Ruby RSS
Jul 30th, 2010
0

Obeserve_field

Expand Post »
My observe field doesn't do anything any idea why.

Ruby Syntax (Toggle Plain Text)
  1. <%= observe_field 'keyword',
  2. :frequency => 0.5,
  3. :update => 'results',
  4. :loading => "Element.show('.spinner')",
  5. :complete => "Element.hide('.spinner')",
  6. :url => { :action=> 'search_results' },
  7. :with => 'keyword' %>
  8.  
  9.  
  10. <%= form_remote_tag :url =>{ :action => :search_results },
  11. :update => "results",
  12. :loading => "$('.spinner').show()",
  13. :complete => visual_effect(:slide_down, "results", :duration => 0.9) %>
  14.  
  15.  
  16.  
  17. <fieldset>
  18. <legend>Tutor Search.</legend>
  19. <label for="searchItField">Keyword Search.</label>
  20.  
  21. <%= text_field_tag(:keyword) %>

And here is my controller

Ruby Syntax (Toggle Plain Text)
  1. def search_results
  2. keyword = params[:keyword]
  3. @tutors = Tutors.find(:all,:conditions => ["category LIKE ?", '%' + keyword + '%'])
  4. end
Reputation Points: 10
Solved Threads: 1
Light Poster
alexgv14 is offline Offline
49 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Ruby Forum Timeline: Ruby on Rails jQuery Visual Effect
Next Thread in Ruby Forum Timeline: Newbie question about embedding ruby in html





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC