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
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 10 def create @attachment = ::Dorsale::Alexandrie::Attachment.new() :create, @attachment if @attachment.save flash[:notice] = t("messages.attachments.create_ok") else flash[:alert] = t("messages.attachments.create_error") end redirect_to_back_url end |
#destroy ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 42 def destroy :delete, @attachment if @attachment.destroy flash[:notice] = t("messages.attachments.delete_ok") else flash[:alert] = t("messages.attachments.delete_error") end redirect_to_back_url end |
#edit ⇒ Object
24 25 26 27 28 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 24 def edit :update, @attachment render layout: false end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/dorsale/alexandrie/attachments_controller.rb', line 30 def update :update, @attachment if @attachment.update_attributes() flash[:notice] = t("messages.attachments.update_ok") else flash[:alert] = t("messages.attachments.update_error") end redirect_to_back_url end |