Class: Kaui::BundleTagsController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Kaui::BundleTagsController
- Defined in:
- app/controllers/kaui/bundle_tags_controller.rb
Instance Method Summary collapse
Methods inherited from EngineController
Methods included from ErrorHelper
Instance Method Details
#edit ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/kaui/bundle_tags_controller.rb', line 16 def edit @bundle_id = params[:bundle_id] begin @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::(@bundle_id) rescue => e flash[:error] = "Error while retrieving tags information: #{as_string(e)}" end end |
#show ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/kaui/bundle_tags_controller.rb', line 3 def show bundle_id = params[:id] if bundle_id.present? begin = Kaui::KillbillHelper::(bundle_id) rescue => e flash[:error] = "Error while retrieving tags information: #{as_string(e)}" end else flash[:error] = "No account id given" end end |
#update ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/kaui/bundle_tags_controller.rb', line 28 def update begin bundle = Kaui::KillbillHelper::get_bundle(params[:bundle_id]) = params[:tags] Kaui::KillbillHelper::(bundle.bundle_id, ) redirect_to Kaui.bundle_home_path.call(bundle.bundle_id) rescue => e flash[:error] = "Error while updating tags: #{as_string(e)}" end end |