Class: RailsServerMonitor::SnapshotsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/rails_server_monitor/snapshots_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_snapshotObject



13
14
15
# File 'app/controllers/rails_server_monitor/snapshots_controller.rb', line 13

def current_snapshot
  @current_snapshot ||= RailsServerMonitor::ServerSnapshot.find_by(id: params[:id])
end

#require_current_snapshotObject



17
18
19
# File 'app/controllers/rails_server_monitor/snapshots_controller.rb', line 17

def require_current_snapshot
  redirect_to root_path, notice: "Server not found" if current_snapshot.blank?
end

#showObject



7
8
9
10
11
# File 'app/controllers/rails_server_monitor/snapshots_controller.rb', line 7

def show
  @snapshot = current_snapshot

  @title = "Snapshot - #{@snapshot.id}"
end