RailsCasts Pro episodes are now free!

Learn more or hide this

Andy Macdonald's Profile

GitHub User: theandym

Site: http://theandym.com

Comments by Andy Macdonald

Avatar

You can do this:

@search = Product.search(params[:search])
@search.meta_sort ||= 'name.asc'

(Source: http://craiccomputing.blogspot.com/2010/10/searchlogic-versus-metasearch-and.html )