rails generate controller search
get 'search' => 'search#search', :as => :search
class SearchController < ApplicationController
def search
@search = Sunspot.search(Article, Author, Comment) do
keywords params[:q]
# the rest of your search
end
end
end
<%= render @search.results %>