Sha256: 54fc1d4d5e430422c20f3616cdfcca8bb714f54f30c20499eb0ee2d122798fbf

Contents?: true

Size: 1.25 KB

Versions: 6

Compression:

Stored size: 1.25 KB

Contents

require_dependency "binda/application_controller"

module Binda
  class RepeatersController < ApplicationController
    before_action :set_repeater, only: [:show, :edit, :update, :destroy]

    # GET /repeaters
    def index
      @repeaters = Repeater.all
    end

    # GET /repeaters/1
    def show
    end

    # GET /repeaters/new
    def new
      @repeater = Repeater.new
    end

    # GET /repeaters/1/edit
    def edit
    end

    # POST /repeaters
    def create
      @repeater = Repeater.new(repeater_params)
      @repeater.save
    end

    # PATCH/PUT /repeaters/1
    def update
      @repeater.update(repeater_params)
    end

    # DELETE /repeaters/1
    def destroy
      @repeater.destroy
      # redirect_to repeaters_url, notice: 'Repeater was successfully destroyed.'
      if params['isAjax']
        head :ok
      else
        redirect_to :back, notice: 'Field group was successfully destroyed.'
      end
    end

    private
      # Use callbacks to share common setup or constraints between actions.
      def set_repeater
        @repeater = Repeater.find(params[:id])
      end

      # Only allow a trusted parameter "white list" through.
      def repeater_params
        params.require(:repeater).permit(:name, :slug)
      end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
binda-0.1.5 app/controllers/binda/repeaters_controller.rb
binda-0.1.4 app/controllers/binda/repeaters_controller.rb
binda-0.1.3 app/controllers/binda/repeaters_controller.rb
binda-0.1.2 app/controllers/binda/repeaters_controller.rb
binda-0.1.1 app/controllers/binda/repeaters_controller.rb
binda-0.1.0 app/controllers/binda/repeaters_controller.rb