Class: WcoHosting::AppliancesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/wco_hosting/appliances_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#home

Instance Method Details

#editObject



9
10
11
12
# File 'app/controllers/wco_hosting/appliances_controller.rb', line 9

def edit
  @appliance = WcoHosting::Appliance.find params[:id]
  authorize! :edit, @appliance
end

#indexObject



4
5
6
7
# File 'app/controllers/wco_hosting/appliances_controller.rb', line 4

def index
  authorize! :index, WcoHosting::Appliance
  @appliances = WcoHosting::Appliance.all
end

#newObject



14
15
16
# File 'app/controllers/wco_hosting/appliances_controller.rb', line 14

def new
  authorize! :new, @new_appliance
end

#showObject



18
19
20
21
# File 'app/controllers/wco_hosting/appliances_controller.rb', line 18

def show
  @appliance = WcoHosting::Appliance.find params[:id]
  authorize! :show, @appliance
end

#updateObject



23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/wco_hosting/appliances_controller.rb', line 23

def update
  @appliance = WcoHosting::Appliance.find params[:id]
  authorize! :update, @appliance
  if @appliance.update_attributes( params[:appliance].permit! )
    flash_notice @appliance
  else
    flash_alert @appliance
  end
  redirect_to action: :index
end