Class: IshManager::LeadActionTemplatesController
Instance Method Summary
collapse
#basic_auth, #home, #tinymce
Instance Method Details
[View source]
5
6
7
8
9
10
11
12
13
14
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 5
def create
authorize! :create, Office::LeadActionTemplate
@tmpl = ::Office::LeadActionTemplate.new params[:tmpl].permit!
if @tmpl.save
flash_notice 'saved'
else
flash_alert "cannot save: #{@tmpl.errors.full_messages.join(', ')}."
end
redirect_to action: :index
end
|
[View source]
16
17
18
19
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 16
def edit
@tmpl = Office::LeadActionTemplate.find params[:id]
authorize! :edit, @tmpl
end
|
[View source]
21
22
23
24
25
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 21
def index
authorize! :index, Office::LeadActionTemplate
@tmpls = ::Office::LeadActionTemplate.all
@new_lat = ::Office::LeadActionTemplate.new
end
|
[View source]
27
28
29
30
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 27
def new
authorize! :new, Office::LeadActionTemplate
@tmpl = ::Office::LeadActionTemplate.new
end
|