Class: IshManager::LeadActionTemplatesController
Instance Method Summary
collapse
#basic_auth, #home, #tinymce
Instance Method Details
#create ⇒ Object
4
5
6
7
8
9
10
11
12
13
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 4
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
|
#edit ⇒ Object
15
16
17
18
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 15
def edit
@tmpl = Office::LeadActionTemplate.find params[:id]
authorize! :edit, @tmpl
end
|
#index ⇒ Object
20
21
22
23
24
|
# File 'app/controllers/ish_manager/lead_action_templates_controller.rb', line 20
def index
authorize! :index, Office::LeadActionTemplate
@tmpls = ::Office::LeadActionTemplate.all
@new_lat = ::Office::LeadActionTemplate.new
end
|