Class: Gaku::AttachmentsController
- Inherits:
-
GakuController
- Object
- CoreController
- GakuController
- Gaku::AttachmentsController
- Includes:
- PolyController
- Defined in:
- app/controllers/gaku/attachments_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #download ⇒ Object
- #edit ⇒ Object
- #new ⇒ Object
- #recovery ⇒ Object
- #soft_delete ⇒ Object
- #update ⇒ Object
Methods inherited from GakuController
Instance Method Details
#create ⇒ Object
16 17 18 19 20 |
# File 'app/controllers/gaku/attachments_controller.rb', line 16 def create @attachment = @attachable..create() set_count respond_with @attachment end |
#destroy ⇒ Object
33 34 35 36 |
# File 'app/controllers/gaku/attachments_controller.rb', line 33 def destroy @attachment.destroy! respond_with @attachment end |
#download ⇒ Object
43 44 45 46 |
# File 'app/controllers/gaku/attachments_controller.rb', line 43 def download @attachment = Attachment.find(params[:id]) send_file @attachment.asset.path end |
#edit ⇒ Object
22 23 24 |
# File 'app/controllers/gaku/attachments_controller.rb', line 22 def edit respond_with @attachment end |
#new ⇒ Object
11 12 13 14 |
# File 'app/controllers/gaku/attachments_controller.rb', line 11 def new @attachment = @attachable..new respond_with @attachment end |
#recovery ⇒ Object
48 49 50 51 |
# File 'app/controllers/gaku/attachments_controller.rb', line 48 def recovery @attachment.recover respond_with @attachment end |
#soft_delete ⇒ Object
38 39 40 41 |
# File 'app/controllers/gaku/attachments_controller.rb', line 38 def soft_delete @attachment.soft_delete respond_with @attachment end |
#update ⇒ Object
26 27 28 29 30 31 |
# File 'app/controllers/gaku/attachments_controller.rb', line 26 def update @attachment.update() respond_with(@attachment) do |format| format.html { redirect_to :back } end end |