Class: Kaui::AdminController
- Inherits:
-
EngineController
- Object
- ApplicationController
- EngineController
- Kaui::AdminController
- Defined in:
- app/controllers/kaui/admin_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
#index ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/kaui/admin_controller.rb', line 7 def index begin @clock = Kaui::Admin.get_clock(nil, ) rescue KillBillClient::API::NotFound flash[:error] = 'Failed to get current KB clock: Kill Bill server must be started with system property org.killbill.server.test.mode=true' redirect_to admin_tenants_path and return end params.permit! respond_to do |format| format.html format.js end end |
#set_clock ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/kaui/admin_controller.rb', line 23 def set_clock if params[:commit] == 'Submit' date = Date.parse(params[:new_date]).strftime('%Y-%m-%d') msg = I18n.translate('flashes.notices.clock_updated_successfully', new_date: date) else date = nil msg = I18n.translate('flashes.notices.clock_reset_successfully') end begin Kaui::Admin.set_clock(date, nil, ) rescue KillBillClient::API::NotFound flash[:error] = 'Failed to set current KB clock: Kill Bill server must be started with system property org.killbill.server.test.mode=true' redirect_to admin_tenants_path and return end redirect_to admin_path, notice: msg end |