Module: BetterRailsDebugger::ApplicationHelper

Defined in:
app/helpers/better_rails_debugger/application_helper.rb

Instance Method Summary collapse

Instance Method Details



3
4
5
6
7
8
9
10
11
# File 'app/helpers/better_rails_debugger/application_helper.rb', line 3

def order_link(title, column, object)
  order = params[:order].to_s == 'asc' ? 'desc' : 'asc'
  link_class = params[:column] == column ? "text-primary" : "text-light"
  if object.kind_of? GroupInstance
    link_to title, objects_group_instance_url(object, column: column, order: order), class: link_class
  else
    title
  end
end