Class: Manage::AttachmentsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/chaskiq/manage/attachments_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



25
26
27
28
29
30
31
# File 'app/controllers/chaskiq/manage/attachments_controller.rb', line 25

def create
  @attachment = @campaign.attachments.create(resource_params)
  respond_to do |format|
    format.html
    format.json { render json: @attachment }
  end
end

#indexObject



9
10
11
12
13
14
15
# File 'app/controllers/chaskiq/manage/attachments_controller.rb', line 9

def index
  @attachments = @campaign.attachments.page(params[:page]).per(50)
  respond_to do |format|
    format.html
    format.json { render json: @attachments }
  end
end

#newObject



21
22
23
# File 'app/controllers/chaskiq/manage/attachments_controller.rb', line 21

def new
  @attachment = @campaign.attachments.new
end

#showObject



17
18
19
# File 'app/controllers/chaskiq/manage/attachments_controller.rb', line 17

def show
  @attachment = @campaign.attachments.find(params[:id])
end