Sha256: 7d1519aa8a380c60a1124bf381193948579a90821022f7d47b8d681573939a03

Contents?: true

Size: 1.28 KB

Versions: 13

Compression:

Stored size: 1.28 KB

Contents

class Kaui::TagDefinitionsController < Kaui::EngineController

  def index
    begin
      @tag_definitions = Kaui::TagDefinition.all('NONE', options_for_klient)
    rescue => e
      flash.now[:error] = "Error while retrieving tag definitions: #{as_string(e)}"
      @tag_definitions  = []
    end
  end

  def new
    @tag_definition = Kaui::TagDefinition.new
  end

  def create
    @tag_definition = Kaui::TagDefinition.new(params[:tag_definition])

    begin
      @tag_definition = @tag_definition.create(current_user.kb_username, params[:reason], params[:comment], options_for_klient)
      redirect_to kaui_engine.tag_definitions_path, :notice => 'Tag definition successfully created'
    rescue => e
      flash.now[:error] = "Error while creating tag definition: #{as_string(e)}"
      render :action => :new
    end
  end

  def destroy
    @tag_definition = Kaui::TagDefinition.find_by_id(params[:id], 'NONE', options_for_klient)

    begin
      @tag_definition.delete(current_user.kb_username, params[:reason], params[:comment], options_for_klient)
      redirect_to kaui_engine.tag_definitions_path, :notice => 'Tag definition successfully deleted'
    rescue => e
      flash.now[:error] = "Error while deleting tag definition: #{as_string(e)}"
      render :action => :index
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kaui-0.16.2 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.16.1 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.16.0 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.5 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.4 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.3 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.2 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.1 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.15.0 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.14.2 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.14.1 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.14.0 app/controllers/kaui/tag_definitions_controller.rb
kaui-0.12.0 app/controllers/kaui/tag_definitions_controller.rb