Class: Api::V2::WebhookTemplatesController
Instance Method Summary
collapse
#location_params, #organization_params, #webhook_template_params
Instance Method Details
#clone ⇒ Object
78
79
80
81
82
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 78
def clone
@webhook_template = @webhook_template.dup
@webhook_template.name = params[:webhook_template][:name]
process_response @webhook_template.save
end
|
#create ⇒ Object
45
46
47
48
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 45
def create
@webhook_template = WebhookTemplate.new(webhook_template_params)
process_response @webhook_template.save
end
|
#destroy ⇒ Object
71
72
73
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 71
def destroy
process_response @webhook_template.destroy
end
|
#export ⇒ Object
86
87
88
89
90
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 86
def export
send_data @webhook_template.to_erb, type: 'text/plain',
disposition: 'attachment',
filename: @webhook_template.filename
end
|
#import ⇒ Object
57
58
59
60
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 57
def import
@webhook_template = WebhookTemplate.import!(*import_attrs_for(:webhook_template))
process_response @webhook_template
end
|
#index ⇒ Object
15
16
17
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 15
def index
@webhook_templates = resource_scope_for_index
end
|
#show ⇒ Object
21
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 21
def show; end
|
#update ⇒ Object
65
66
67
|
# File 'app/controllers/api/v2/webhook_templates_controller.rb', line 65
def update
process_response @webhook_template.update(webhook_template_params)
end
|