Class: Wco::OfficeActionsController
Instance Method Summary
collapse
#home, #tinymce
#my_truthy?, #obfuscate, #pp_amount, #pp_currency, #pp_date, #pp_datetime, #pp_money, #pp_percent, #pp_time, #pretty_date
Instance Method Details
#create ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
|
# File 'app/controllers/wco/office_actions_controller.rb', line 6
def create
@oa = OA.new params[:oa].permit!
authorize! :update, @oa
if @oa.save
flash_notice @oa
else
flash_alert @oa
end
redirect_to action: :index
end
|
#destroy ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'app/controllers/wco/office_actions_controller.rb', line 18
def destroy
@oa = OA.find params[:id]
authorize! :destroy, @oa
if @oa.delete
flash_notice @oa
else
flash_alert @oa
end
redirect_to action: :index
end
|
#edit ⇒ Object
29
30
31
32
|
# File 'app/controllers/wco/office_actions_controller.rb', line 29
def edit
@oa = OA.find params[:id]
authorize! :edit, @oa
end
|
#index ⇒ Object
34
35
36
37
|
# File 'app/controllers/wco/office_actions_controller.rb', line 34
def index
authorize! :index, OA
@oas = OA.all
end
|
#new ⇒ Object
39
40
41
42
|
# File 'app/controllers/wco/office_actions_controller.rb', line 39
def new
@oa = OA.new
authorize! :new, @oa
end
|
#show ⇒ Object
44
45
46
47
|
# File 'app/controllers/wco/office_actions_controller.rb', line 44
def show
@oa = OA.find params[:id]
authorize! :show, @oa
end
|
#update ⇒ Object
49
50
51
52
53
54
55
56
57
58
59
|
# File 'app/controllers/wco/office_actions_controller.rb', line 49
def update
@oa = OA.find params[:id]
authorize! :update, @oa
if @oa.update params[:oa].permit!
flash_notice @oa
else
flash_alert @oa
end
redirect_to action: :index
end
|