Class: Kaui::BundleTagsController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Kaui::BundleTagsController
- Defined in:
- app/controllers/kaui/bundle_tags_controller.rb
Constant Summary
Constants included from EngineControllerUtil
EngineControllerUtil::SIMPLE_PAGINATION_THRESHOLD
Instance Method Summary collapse
Methods inherited from EngineController
#check_for_redirect_to_tenant_screen, #current_ability, #current_user, #options_for_klient, #populate_account_details, #retrieve_allowed_users_for_current_user, #retrieve_tenants_for_current_user
Instance Method Details
#edit ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'app/controllers/kaui/bundle_tags_controller.rb', line 3 def edit @bundle_id = params.require(:bundle_id) fetch_tag_names = promise { (Kaui::Tag.all_for_bundle(@bundle_id, false, 'NONE', ).map { |tag| tag.tag_definition_name }).sort } = promise { Kaui::TagDefinition.all_for_bundle() } @tag_names = wait(fetch_tag_names) @available_tags = wait() end |
#update ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/kaui/bundle_tags_controller.rb', line 13 def update account_id = params.require(:account_id) bundle_id = params.require(:bundle_id) = [] params.each do |tag, tag_name| tag_info = tag.split('_') next if tag_info.size != 2 or tag_info[0] != 'tag' << tag_info[1] end Kaui::Tag.set_for_bundle(bundle_id, , current_user.kb_username, params[:reason], params[:comment], ) redirect_to kaui_engine.account_bundles_path(account_id), :notice => 'Bundle tags successfully set' end |