Class: ActiveBatch::BatchesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/active_batch/batches_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /batches



22
23
24
25
26
27
28
29
30
# File 'app/controllers/active_batch/batches_controller.rb', line 22

def create
  @batch = Batch.new(batch_params)

  if @batch.save
    redirect_to @batch, notice: 'Batch was successfully created.'
  else
    render :new
  end
end

#destroyObject

DELETE /batches/1



33
34
35
36
# File 'app/controllers/active_batch/batches_controller.rb', line 33

def destroy
  @batch.destroy
  redirect_to batches_url, notice: 'Batch was successfully destroyed.'
end

#indexObject

GET /batches



8
9
10
# File 'app/controllers/active_batch/batches_controller.rb', line 8

def index
  @batches = Batch.all
end

#newObject

GET /batches/new



17
18
19
# File 'app/controllers/active_batch/batches_controller.rb', line 17

def new
  @batch = Batch.new
end

#showObject

GET /batches/1



13
14
# File 'app/controllers/active_batch/batches_controller.rb', line 13

def show
end