Sha256: 7eb2da240778c218833c4b8e124785ac7c971b1b26a5e55731fece4296f0ee36

Contents?: true

Size: 1.14 KB

Versions: 24

Compression:

Stored size: 1.14 KB

Contents

class AddressesController < ApplicationController
  before_action :set_address, only: [:show, :edit, :update, :destroy]

  # GET /addresses
  def index
    @addresses = Address.all
  end

  # GET /addresses/1
  def show
  end

  # GET /addresses/new
  def new
    @address = Address.new
  end

  # GET /addresses/1/edit
  def edit
  end

  # POST /addresses
  def create
    @address = Address.new(address_params)

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

  # PATCH/PUT /addresses/1
  def update
    if @address.update(address_params)
      redirect_to @address, notice: 'Address was successfully updated.'
    else
      render :edit
    end
  end

  # DELETE /addresses/1
  def destroy
    @address.destroy
    redirect_to addresses_url, notice: 'Address was successfully destroyed.'
  end

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

    # Only allow a list of trusted parameters through.
    def address_params
      params.fetch(:address, {})
    end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
eitil-2.0.8 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.7 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.6 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.5 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.4 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.3 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.2 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.1 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-2.0.0 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.4.1 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.4.0 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.12 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.11 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.10 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.9 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.8 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.7 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.6 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.5 spec/dummy_app/app/controllers/addresses_controller.rb
eitil-1.3.4 spec/dummy_app/app/controllers/addresses_controller.rb