Sha256: f0ebf417f8382f2f48c232cfe92a402c23949bb32d20764c75d2fdeb4b8b7088

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

class Kaui::BundleTagsController < Kaui::EngineController

  def show
    bundle_id = params[:id]
    if bundle_id.present?
      tags = Kaui::KillbillHelper::get_tags_for_bundle(bundle_id)
    else
      flash[:error] = "No account id given"
    end
  end

  def edit
    @bundle_id = params[:bundle_id]
    @available_tags = Kaui::KillbillHelper::get_tag_definitions.sort {|tag_a, tag_b| tag_a.name.downcase <=> tag_b.name.downcase }

    @bundle = Kaui::KillbillHelper::get_bundle(@bundle_id)
    @tags = Kaui::KillbillHelper::get_tags_for_bundle(@bundle_id)
  end

  def update
    bundle = Kaui::KillbillHelper::get_bundle(params[:bundle_id])
    tags = params[:tags]

    Kaui::KillbillHelper::set_tags_for_bundle(bundle.bundle_id, tags)
    redirect_to kaui_engine.bundle_home_path.call(bundle.external_key)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kaui-0.1.5 app/controllers/kaui/bundle_tags_controller.rb
kaui-0.1.4 app/controllers/kaui/bundle_tags_controller.rb