Class: EducodeSales::LogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/educode_sales/logs_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate_admin, #authenticate_request, #current_user, #filter, #is_commissioner_above?, #paginate, #render_failure, #render_success, #subject_members, #subject_staffs, #subject_url

Methods included from ApplicationHelper

#add_businesses_score, #base_url, #collection_amount_score, #completion_rate, #current?, #disk_filename, #get_businesses_chart, #handled_data, #handled_time_data, #handled_time_data_accurate, #relative_path, #signed_amount_score, #storage_path, #url_to_avatar, #visits_score

Instance Method Details

#indexObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/educode_sales/logs_controller.rb', line 5

def index
  respond_to do |format|
    format.html do
    end
    format.json do
      @logs = Impression.where(impressionable_type: "EducodeSales::Staff")
      if params[:sort].present? && params[:sort][:field]
        @logs = @logs.order("#{params[:sort][:field]} #{params[:sort][:order]}")
      else
        @logs = @logs.order("created_at desc")
      end
      @logs = @logs.page(params[:page]).per(params[:limit])
    end
  end
end