RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: JohnnyClutch
Here's the cludge I used:
if params[:search].nil? params[:search] = Hash.new end if params[:search][:meta_sort].nil? params[:search][:meta_sort] = "my_sort_field.desc" end
Anyone figure out yet now to set a default sort (where one not specified)?
Thanks Ryan.
Here's the cludge I used:
if params[:search].nil?
params[:search] = Hash.new
end
if params[:search][:meta_sort].nil?
params[:search][:meta_sort] = "my_sort_field.desc"
end
Anyone figure out yet now to set a default sort (where one not specified)?
Thanks Ryan.