Class: Binda::RepeatersController

Inherits:
ApplicationController show all
Defined in:
app/controllers/binda/repeaters_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#after_sign_in_path_for, #after_sign_out_path_for, #set_locale

Instance Method Details

#createObject

POST /repeaters



26
27
28
29
# File 'app/controllers/binda/repeaters_controller.rb', line 26

def create
  @repeater = Repeater.new(repeater_params)
  @repeater.save
end

#destroyObject

DELETE /repeaters/1



37
38
39
40
41
42
43
44
45
# File 'app/controllers/binda/repeaters_controller.rb', line 37

def destroy
  @repeater.destroy!
  # redirect_to repeaters_url, notice: 'Repeater was successfully destroyed.'
  if params['isAjax']
    render json: { target_id: params[:target_id] }, status: 200
  else
    redirect_to :back, notice: 'Field group was successfully destroyed.'
  end
end

#editObject

GET /repeaters/1/edit



22
23
# File 'app/controllers/binda/repeaters_controller.rb', line 22

def edit
end

#indexObject

GET /repeaters



8
9
10
# File 'app/controllers/binda/repeaters_controller.rb', line 8

def index
  @repeaters = Repeater.all
end

#newObject

GET /repeaters/new



17
18
19
# File 'app/controllers/binda/repeaters_controller.rb', line 17

def new
  @repeater = Repeater.new
end

#showObject

GET /repeaters/1



13
14
# File 'app/controllers/binda/repeaters_controller.rb', line 13

def show
end

#updateObject

PATCH/PUT /repeaters/1



32
33
34
# File 'app/controllers/binda/repeaters_controller.rb', line 32

def update
  @repeater.update(repeater_params)
end