I'm always looking for ways to make improvements to the site. Sometimes the ideas come from my friends, once in a while from users who submit ideas through the feedback form, and other times I'm a victim of my own inspiration. Regardless of where the ideas come from, I sometimes have a hard time keeping my hands of the keyboard even when I should be packing for vacation. Just before the Mayweather fight about a week ago and only a few hours away from my departure to Florida, I decided to add a little more functionality to the search form on the music section.

One of the limitations of the standard search is that when you search for some term, you are returned all results for each album individually. So searching for "oakenfold" would return dozens of results, even though the results only stem from maybe 10 albums. I wanted to make it possible so that you could search and just be returned the albums relevant to the search. Thus, I started writing code.

Since RoR makes it easy to add AJAX functionality, I used the observe_form method combined with the find_by_contents method provided by the acts_as_ferret plugin. With about 20 lines of code and some modifications to my CSS , searching through music is a whole lot easier. To try it out for yourself, just head on over to to the music section and type in a search term. Rather than pressing enter, just watch as the results magically appear before your eyes.

Current Rating: 4.0 rating from 1 vote

  • Current rating is 4
  •  
  •  
  •  
  •  
  •  

One Response to "Giving the music search a boost"

635661_thumb

Shawna Pepper

May 16, 2007 at 11:28 am

Okay, I have to say that this is one of the “niftier” additions, and currently my favorite addition to the site. Way to go Ruby king :-) Keep the gadgets coming!

Comments are Closed

Name: (Required)
Website:
Comment:
Remember my info