Sha256: d7438b62a69b0ce75924fe532e3c5761471bc5e0b4b70ef02cb15062825c7609

Contents?: true

Size: 1.28 KB

Versions: 15

Compression:

Stored size: 1.28 KB

Contents

class PlacementsController < ApplicationController
  before_action :set_placement, only: [:show, :edit, :update, :destroy]

  # GET /placements
  def index
    @placements = Placement.all
  end

  # GET /placements/1
  def show
  end

  # GET /placements/new
  def new
    @placement = Placement.new
  end

  # GET /placements/1/edit
  def edit
  end

  # POST /placements
  def create
    @placement = Placement.new(placement_params)

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

  # PATCH/PUT /placements/1
  def update
    if @placement.update(placement_params)
      redirect_to @placement, notice: 'Placement was successfully updated.'
    else
      render :edit
    end
  end

  # DELETE /placements/1
  def destroy
    @placement.destroy
    redirect_to placements_url, notice: 'Placement was successfully destroyed.'
  end

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

    # Only allow a trusted parameter "white list" through.
    def placement_params
      params.require(:placement).permit(:epom_id, :zone_id, :placement_type, :name, :ad_unit_id, :size_height, :size_width)
    end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
epom_rails-1.4.4 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.4.2 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.4.1 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.4.0 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.3.6 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.3.5 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.3.2 test/dummy/app/controllers/placements_controller.rb
epom_rails-1.0.0 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.9 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.8 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.7 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.6 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.5 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.2 test/dummy/app/controllers/placements_controller.rb
epom_rails-0.4.1 test/dummy/app/controllers/placements_controller.rb