Class: AdminController
- Inherits:
-
OfficeController
- Object
- ApplicationController
- OfficeController
- AdminController
- Defined in:
- app/controllers/admin_controller.rb
Direct Known Subclasses
BasketsController, CategoriesController, ClerksController, ManageController, OrdersController, ProductsController, PurchasesController, SuppliersController
Instance Method Summary collapse
Methods inherited from OfficeController
Methods included from OfficeHelper
#best_euros, #current_basket, #current_basket_or_nil, #current_clerk, #date, #euros, #has_ssl?, #markdown, #new_basket, #paginate, #shipping_method
Instance Method Details
#clean_search ⇒ Object
16 17 18 19 20 21 22 |
# File 'app/controllers/admin_controller.rb', line 16 def clean_search q = params[:q] return unless q q.keys.each do |key| q.delete(key) if q[key].blank? end end |
#require_admin ⇒ Object
10 11 12 13 14 |
# File 'app/controllers/admin_controller.rb', line 10 def require_admin clerk = current_clerk return if clerk and clerk.admin redirect_to sign_in_url end |