RailsCasts Pro episodes are now free!

Learn more or hide this

JohnnyClutch's Profile

GitHub User: JohnnyClutch

Comments by

Avatar

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

Avatar

Anyone figure out yet now to set a default sort (where one not specified)?

Thanks Ryan.