app/controllers/admin/cms_controller.rb
def sort_column

      (params.key?( :s ) and @model_class.column_names.include?( params[:s] )) ? params[:s] : @default_sort[:column]

    end
# Helper function that returns the current sort column, derived from the @s@ query parameter, and reverting to
# @default_sort[:column]@.
#
# @TODO: allow sorting on foreign keys
Helper function that returns the current sort column, derived from the @s@ query parameter, and reverting to
Helper function that returns the current sort column derived from the @s@ query parameter and reverting to
def sort_column
      (params.key?( :s ) and @model_class.column_names.include?( params[:s] )) ? params[:s] : @default_sort[:column]
    end
def sort_column ( params . key? ( :s ) and @model_class . column_names . include? ( params [ :s ] ) ) ? params [ :s ] : @default_sort [ :column ] end
Helper function that returns the current sort column, derived from the @s@ query parameter, and reverting to
Helper function that returns the current sort column derived from the @s@ query parameter and reverting to
default_sort[:column]@.
None
TODO:
allow sorting on foreign keys
allow sorting on foreign keys