Class: Nuntius::Admin::Layouts::AttachmentsController

Inherits:
Nuntius::ApplicationController show all
Defined in:
app/controllers/nuntius/admin/layouts/attachments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
# File 'app/controllers/nuntius/admin/layouts/attachments_controller.rb', line 11

def create
  params[:attachments].each do |file|
    @layout.attachments.attach(file)
  end
end

#destroyObject



17
18
19
20
21
22
# File 'app/controllers/nuntius/admin/layouts/attachments_controller.rb', line 17

def destroy
  attachment = @layout.attachments.find_by(id: params[:id])
  attachment&.purge

  render :create
end

#indexObject



9
# File 'app/controllers/nuntius/admin/layouts/attachments_controller.rb', line 9

def index; end