Class: Rearview::DashboardsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rearview/dashboards_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
# File 'app/controllers/rearview/dashboards_controller.rb', line 15

def create
  upsert
  render :show
end

#destroyObject



25
26
27
28
29
# File 'app/controllers/rearview/dashboards_controller.rb', line 25

def destroy
  @dashboard = Rearview::Dashboard.find params[:id]
  @dashboard.destroy
  render :show
end

#errorsObject



31
32
33
# File 'app/controllers/rearview/dashboards_controller.rb', line 31

def errors
  @job_errors = Rearview::JobError.calculate_durations(Rearview::JobError.application_errors(params[:id]).order_created.load)
end

#indexObject



7
8
9
# File 'app/controllers/rearview/dashboards_controller.rb', line 7

def index
  @dashboards = Rearview::Dashboard.roots
end

#showObject



11
12
13
# File 'app/controllers/rearview/dashboards_controller.rb', line 11

def show
  @dashboard = Rearview::Dashboard.find(params[:id])
end

#updateObject



20
21
22
23
# File 'app/controllers/rearview/dashboards_controller.rb', line 20

def update
  upsert
  render :show
end