I might be terribly late on this one but it’s so ridiculously ill I just had to make a post. Shazam is a truly amazing music discovery engine! I just checked it out on my iPhone and it recognized about 2/3 of the songs I played (and I did not make it easy for it…)
It’s available for different mobiles and of course the mighty iPhone (in the app store)
njoy!
Put this in your view to add an AJAX search.
This will send a request to your search-method every time the user types sth. in the search field (the field is checked once per second here).
element_id is the id of the element (div, table) to be updated. If your familiar with RoR basics, the rest should be obvious.
If your running a rather big app you should definitely think about reducing the frequency in the observe_field and/or caching the search results somewhere (in your model for example, read this) to avoid your database of being queried all the time (once per second in this example).
<% form_tag :id => "search" do -%>
<%= text_field_tag('search_field, params[:query], :autocomplete => "off" ) %>
<% end -%>
<%= observe_field 'search_field_activities', :frequency => 1,
:update => "element_id",
:url =>{:controller => "your_controller", :action => "search" },
:with => "query" %>
comments? mail me (zoomnzoomn a t gmail.com)!
In exactly one month I will start my internship at socialight in NYC.
Cant tell you how THRILLED I am…!