Sha256: e4b9f42eaaaba91a71115f32ef498acff87fa6176f95df7f87a3c61f8fd04114

Contents?: true

Size: 1022 Bytes

Versions: 23

Compression:

Stored size: 1022 Bytes

Contents

class IshManager::TagsController < IshManager::ApplicationController

  before_action :set_lists

  def index
    @tags = Tag.unscoped
    authorize! :index, Tag.new
  end
  
  def show
    @tag = Tag.unscoped.find params[:id]
    authorize! :show, @tag
  end

  def new
    @tag = Tag.new
    authorize! :new, @tag
  end

  def create
    @tag = Tag.create params[:tag].permit!
    authorize! :create, @tag
    if @tag.save
      flash[:notice] = 'Success.'
      redirect_to tags_path
    else
      puts! @tag.errors, "error creating tag."
      flash[:error] = "No luck. #{@tag.errors.messages}" 
      render :action => :new
    end
  end

  def edit
    @tag = Tag.unscoped.find params[:id]
    authorize! :edit, @tag
  end

  def update
    @tag = Tag.unscoped.find params[:id]
    authorize! :update, @tag
    if @tag.update_attributes params[:tag].permit!
      flash[:notice] = 'Success.'
      redirect_to tags_path
    else
      flash[:error] = 'No luck.'
      render :action => :new
    end
  end
  
end


Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
ish_manager-0.1.8.46 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.45 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.44 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.43 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.41 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.40 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.39 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.38 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.37 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.36 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.35 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.34 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.33 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.32 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.31 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.30 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.29 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.28 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.27 app/controllers/ish_manager/tags_controller.rb
ish_manager-0.1.8.26 app/controllers/ish_manager/tags_controller.rb