Class: IshManager::WcoLeadsetsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/ish_manager/wco_leadsets_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#basic_auth, #home, #tinymce

Instance Method Details

#createObject



4
5
# File 'app/controllers/ish_manager/wco_leadsets_controller.rb', line 4

def create
end

#editObject



7
8
9
10
# File 'app/controllers/ish_manager/wco_leadsets_controller.rb', line 7

def edit
  @wco_leadset = Wco::Leadset.find params[:id]
  authorize! :edit, @wco_leadset
end

#indexObject



12
13
14
15
# File 'app/controllers/ish_manager/wco_leadsets_controller.rb', line 12

def index
  authorize! :index, Wco::Leadset
  @wco_leadsets = Wco::Leadset.all
end

#showObject



17
18
19
20
# File 'app/controllers/ish_manager/wco_leadsets_controller.rb', line 17

def show
  @wco_leadset = Wco::Leadset.find params[:id]
  authorize! :show, @wco_leadset
end

#updateObject



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

def update
  @wco_leadset = Wco::Leadset.find params[:id]
  authorize! :update, @wco_leadset
  flag = @wco_leadset.update params[:wco_leadset].permit!
  if flag
    flash_notice "ok"
  else
    flash_alert "sorry"
  end
  redirect_to action: :index
end