Class: Alchemy::Custom::Model::Admin::BaseWithGlobalizeController
- Inherits:
-
BaseController
- Object
- BaseController
- Alchemy::Custom::Model::Admin::BaseWithGlobalizeController
- Defined in:
- app/controllers/alchemy/custom/model/admin/base_with_globalize_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
belongs_to, #create, #destroy, #edit, #export_csv, #export_csv_full, #new, #show, #update
Instance Method Details
#index ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/alchemy/custom/model/admin/base_with_globalize_controller.rb', line 12 def index @query = base_class.ransack(params[:q]) @objects = @query.result(distinct: true) @objects = @objects.accessible_by(current_ability) @total_objects = @objects @objects = @objects.page(params[:page]). per(params[:per_page] || (base_class::DEFAULT_PER_PAGE if base_class.const_defined? :DEFAULT_PER_PAGE) || 25) instance_variable_set "@#{base_class.name.demodulize.underscore.downcase.pluralize}", @objects end |