Sha256: 6ecfa5e95c9c521aad25c44d8f9e97ab0bf518232aa1e8ddf77723847ecc61ba

Contents?: true

Size: 949 Bytes

Versions: 1

Compression:

Stored size: 949 Bytes

Contents

module Selections
  class SelectionsController < ApplicationController
    def index
      @selections = Selection.all
    end

    def show
      @selection = Selection.find(params[:id])
    end

    def new
      @selection = Selection.new
    end

    def edit
      @selection = Selection.find(params[:id])
    end

    def create
      @selection = Selection.new(params[:selection])
      if @selection.save
        redirect_to @selection, notice: 'Selection was successfully created.'
      else
        render action: "new"
      end
    end

    def update
      @selection = Selection.find(params[:id])

      if @selection.update_attributes(params[:selection])
        redirect_to @selection, notice: 'Selection was successfully updated.'
      else
        render action: "edit"
      end
    end

    def destroy
      @selection = Selection.find(params[:id])
      @selection.destroy

      redirect_to selections_url
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selections-0.0.1 app/controllers/selections/selections_controller.rb