Class: Rscratch::ExceptionsController

Inherits:
ApplicationController show all
Includes:
SmartListing::Helper::ControllerExtensions
Defined in:
app/controllers/rscratch/exceptions_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authenticate

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/rscratch/exceptions_controller.rb', line 6

def index
  @exceptions = Rscratch::Exception.order("updated_at desc")
  smart_listing_create :exceptions, @exceptions.by_status('new'), partial: "rscratch/exceptions/exception_smartlist"
  smart_listing_create :resolved_exceptions, @exceptions.by_status('resolved'), partial: "rscratch/exceptions/exception_smartlist"
  respond_to do |format|
    format.html # index.html.erb
    format.js
    format.json { render json: @exceptions }
  end      
end

#showObject



16
17
18
19
20
21
# File 'app/controllers/rscratch/exceptions_controller.rb', line 16

def show
  @excp = Rscratch::Exception.find(params[:id])
  @log = @excp.exception_logs.order("created_at desc").page(params[:page]).per(1)
  @historical_data = @excp.exception_logs.select("count(id) as exception_count, date(created_at) as date").group("date(created_at)").order("date(created_at)").last(30)
  rescue Exception => @error          
end