Skip to content

Instantly share code, notes, and snippets.

@meltzerj
Created May 28, 2011 20:25
Show Gist options
  • Save meltzerj/997200 to your computer and use it in GitHub Desktop.
Save meltzerj/997200 to your computer and use it in GitHub Desktop.
def search
@video_results = Video.find_with_index('#{params[:search][:search]}',{:limit => 10})
@user_results = User.find_with_index('#{params[:search][:search]}',{:limit => 10})
@topic_results = Topic.find_with_index('#{params[:search][:search]}',{:limit => 5})
respond_to do |format|
format.html
end
end
acts_as_indexed :fields => [:name]
acts_as_indexed :fields => [:name]
acts_as_indexed :fields => [:title, :description]
<%= simple_form_for :search, :url => search_path, :method => :get do |f| %>
<%= f.input :search, :label => false, :placeholder => "Search... (press Enter)" %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment