Class: SpeedupDashboard::ServersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/speedup_dashboard/servers_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#authorize_server, #find_optional_server, #render_403, #render_error

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
# File 'app/controllers/speedup_dashboard/servers_controller.rb', line 15

def create
  @server = Server.new(server_params)
  if @server.save
    flash[:notice] = t(:notice_server_created)
    redirect_to action: :index
  else
    render :new
  end
end

#indexObject



6
7
8
9
# File 'app/controllers/speedup_dashboard/servers_controller.rb', line 6

def index
  @servers = Server.all
  @server = Server.new
end

#newObject



11
12
13
# File 'app/controllers/speedup_dashboard/servers_controller.rb', line 11

def new
  @server = Server.new
end