Sha256: c3ab9e0a868aebc8ccd63e9c7bf1a5fc1572d57a56d6801e7ce8734cb1187ae6

Contents?: true

Size: 525 Bytes

Versions: 9

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

module RailsServerMonitor
  class SnapshotsController < ApplicationController
    before_action :require_current_snapshot, only: :show

    def show
      @snapshot = current_snapshot

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

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails-server-monitor-0.2.1 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.2.0 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.10 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.9 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.8 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.7 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.6 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.5 app/controllers/rails_server_monitor/snapshots_controller.rb
rails-server-monitor-0.1.4 app/controllers/rails_server_monitor/snapshots_controller.rb