Sha256: 29eb58d54a4395a18414f62b47971e7023476e086663a702f5b62f15a2141aa5

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

class ZonesController < ApplicationController
  before_action :set_zone, only: [:show, :edit, :update, :destroy]

  # GET /zones
  def index
    @zones = Zone.all
  end

  # GET /zones/1
  def show
  end

  # GET /zones/new
  def new
    @zone = Zone.new
  end

  # GET /zones/1/edit
  def edit
  end

  # POST /zones
  def create
    @zone = Zone.new(zone_params)

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

  # PATCH/PUT /zones/1
  def update
    if @zone.update(zone_params)
      redirect_to @zone, notice: 'Zone was successfully updated.'
    else
      render :edit
    end
  end

  # DELETE /zones/1
  def destroy
    @zone.destroy
    redirect_to zones_url, notice: 'Zone was successfully destroyed.'
  end

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

    # Only allow a trusted parameter "white list" through.
    def zone_params
      params.require(:zone).permit(:epom_id, :name, :description, :publisher_id)
    end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
epom_rails-1.4.4 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.4.2 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.4.1 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.4.0 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.3.6 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.3.5 test/dummy/app/controllers/zones_controller.rb
epom_rails-1.3.2 test/dummy/app/controllers/zones_controller.rb