Class: Dorsale::Alexandrie::AttachmentsController
- Inherits:
-
Dorsale::ApplicationController
- Object
- ApplicationController
- Dorsale::ApplicationController
- Dorsale::Alexandrie::AttachmentsController
- Defined in:
- app/controllers/dorsale/alexandrie/attachments_controller.rb
Instance Method Summary collapse
Methods inherited from Dorsale::ApplicationController
Instance Method Details
#create ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 20 def create @attachment = scope.new() @attachment, :create? if @attachment.save notify_attachable(:create) else flash.now[:alert] = t("messages.attachments.create_error") end render_list end |
#destroy ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 52 def destroy @attachment, :delete? if @attachment.destroy notify_attachable(:delete) else flash.now[:alert] = t("messages.attachments.delete_error") end render_list end |
#edit ⇒ Object
34 35 36 37 38 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 34 def edit @attachment, :update? render_list end |
#index ⇒ Object
12 13 14 15 16 17 18 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 12 def index @attachable = find_attachable_from_params @attachable, :read? render_list end |
#update ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 40 def update @attachment, :update? if @attachment.update() notify_attachable(:update) else flash.now[:alert] = t("messages.attachments.update_error") end render_list end |