Class: Stay::Admin::BaseController
- Inherits:
-
Stay::ApplicationController
- Object
- ActionController::Base
- Stay::ApplicationController
- Stay::Admin::BaseController
- Defined in:
- app/controllers/stay/admin/base_controller.rb
Direct Known Subclasses
AddressesController, AmenitiesController, AmenityCategoriesController, BedTypesController, BookingsController, CancellationPoliciesController, ChatsController, CitiesController, CountriesController, DashboardController, FeaturesController, HomeController, HouseRulesController, MessagesController, PaymentMethodsController, PaymentsController, PropertiesController, PropertyCategoriesController, PropertyTypesController, ReviewsController, RolesController, RoomAmenitiesController, RoomTypesController, RoomsController, StatesController, StoresController, TaxesController, UsersController
Instance Method Summary collapse
Methods included from ControllerHelpers::Store
#current_store, #ensure_current_store, #store_locale
Methods included from ControllerHelpers::Currency
#currency_param, #current_currency, #supported_currencies, #supported_currencies_for_all_stores, #supported_currency?
Methods inherited from Stay::ApplicationController
#after_sign_in_path_for, #current_store
Methods included from LocaleHelper
#all_locales_options, #available_locales, #available_locales_options, #config_locale?, #current_locale, #find_with_fallback_default_locale, #locale_full_name, #locale_param, #locale_presentation, #params_locale?, #should_render_locale_dropdown?, #supported_locale?, #supported_locales, #supported_locales_for_all_stores, #supported_locales_options, #user_locale?
Methods included from CurrencyHelper
#currency_options, #currency_presentation, #currency_symbol, #should_render_currency_dropdown?, #supported_currency_options
Instance Method Details
#load_stores ⇒ Object
15 16 17 |
# File 'app/controllers/stay/admin/base_controller.rb', line 15 def load_stores @stores = stores_scope.order(default: :desc) end |
#set_currency ⇒ Object
25 26 27 28 29 |
# File 'app/controllers/stay/admin/base_controller.rb', line 25 def set_currency return if @object.nil? @object.currency = current_currency if model_class.method_defined?(:currency=) end |
#set_current_store ⇒ Object
19 20 21 22 23 |
# File 'app/controllers/stay/admin/base_controller.rb', line 19 def set_current_store return if @object.nil? ensure_current_store(@object) end |