lib/generators/dry_crud/templates/app/controllers/list_controller.rb
def sort_expression
      col = sort_mappings[params[:sort].to_sym] ||
            "#{model_class.table_name}.#{params[:sort]}"
      "#{col} #{sort_dir}"
    end
# Return the sort expression to be used in the list query.
Return the sort expression to be used in the list query.
Return the sort expression to be used in the list query .
def sort_expression
      col = sort_mappings[params[:sort].to_sym] ||
            "#{model_class.table_name}.#{params[:sort]}"
      "#{col} #{sort_dir}"
    end
def sort_expression col = sort_mappings [ params [ :sort ] . to_sym ] || "#{model_class.table_name}.#{params[:sort]}" "#{col} #{sort_dir}" end
Return the sort expression to be used in the list query.
Return the sort expression to be used in the list query .