I’m using MetaSearch in a Rails 3 project although I imagine the search method doesn’t really matter that much.
My controller looks like this:
def index
@search = Household.search(params[:search])
@households = @search.all
end
If there is only a single search result, I want to go directly to the “show” action for that item, otherwise go to the “index” action. (Right now everything goes to the “index” action, which adds another step for the user).
Any ideas how to accomplish this?
you could add something like