Sha256: 913ac1d5c466e55ab1e35412a94585245b2260874d1791e6448f895d1dfc3034

Contents?: true

Size: 1.37 KB

Versions: 17

Compression:

Stored size: 1.37 KB

Contents

class SequencedItemsController < ApplicationController
  before_action :set_sequenced_item, only: [:show, :edit, :update, :destroy]

  # GET /sequenced_items
  def index
    @sequenced_items = SequencedItem.all
  end

  # GET /sequenced_items/1
  def show
  end

  # GET /sequenced_items/new
  def new
    @sequenced_item = SequencedItem.new
  end

  # GET /sequenced_items/1/edit
  def edit
  end

  # POST /sequenced_items
  def create
    @sequenced_item = SequencedItem.new(sequenced_item_params)

    if @sequenced_item.save
      redirect_to @sequenced_item, notice: 'Other item was successfully created.'
    else
      render action: 'new'
    end
  end

  # PATCH/PUT /sequenced_items/1
  def update
    if @sequenced_item.update(sequenced_item_params)
      redirect_to @sequenced_item, notice: 'Other item was successfully updated.'
    else
      render action: 'edit'
    end
  end

  # DELETE /sequenced_items/1
  def destroy
    @sequenced_item.destroy
    redirect_to sequenced_items_url, notice: 'Other item was successfully destroyed.'
  end

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

    # Only allow a trusted parameter "white list" through.
    def sequenced_item_params
      params.require(:sequenced_item).permit(:title, :sequence)
    end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rails_sortable-1.6.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.5.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.4.1 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.4.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.3.2 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.3.1 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.3.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.2.1 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.2.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.1.4 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.1.3 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.1.2 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.1.1 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.1.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-1.0.0 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-0.1.1 spec/dummy/app/controllers/sequenced_items_controller.rb
rails_sortable-0.1.0 spec/dummy/app/controllers/sequenced_items_controller.rb