Sha256: 58aa0f26e6e9a11787ed0ae90289b905ba102626a7fb09c8f0c5b70d4b085a5b

Contents?: true

Size: 566 Bytes

Versions: 5

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

module RailsServerMonitor
  class ServersController < ApplicationController
    before_action :require_current_server, only: %i(show update)

    def show
      @server = current_server
      @chart = RailsServerMonitor::ChartForServer.new(@server)

      @title = @server.display_name
    end

    def current_server
      @current_server ||= RailsServerMonitor::Server.find_by(id: params[:id])
    end

    def require_current_server
      redirect_to root_path, notice: "Server not found" if current_server.blank?
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rails-server-monitor-0.1.8 app/controllers/rails_server_monitor/servers_controller.rb
rails-server-monitor-0.1.7 app/controllers/rails_server_monitor/servers_controller.rb
rails-server-monitor-0.1.6 app/controllers/rails_server_monitor/servers_controller.rb
rails-server-monitor-0.1.5 app/controllers/rails_server_monitor/servers_controller.rb
rails-server-monitor-0.1.4 app/controllers/rails_server_monitor/servers_controller.rb