Class: MegaBar::ApplicationController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- MegaBar::ApplicationController
- Includes:
- Cccux::ApplicationControllerConcern, AuthorizationHelper
- Defined in:
- app/controllers/mega_bar/application_controller.rb
Direct Known Subclasses
BlocksController, CheckboxesController, DatesController, FieldDisplaysController, FieldsController, ImageFromUrlsController, LayablesController, LayoutSectionsController, LayoutsController, MegaDashesController, ModelDisplayCollectionsController, ModelDisplayFormatsController, ModelDisplaysController, ModelsController, OptionsController, PagesController, PasswordFieldsController, PortfoliosController, RadiosController, RecordsFormatsController, SelectsController, SiteJoinsController, SitesController, TemplateSectionsController, TemplatesController, TextareasController, TextboxesController, TextreadsController, ThemeJoinsController, ThemesController
Instance Method Summary collapse
Methods included from AuthorizationHelper
#can_create?, #can_destroy?, #can_edit?, #can_index?, #can_perform_action?, #can_show?, #can_update?, #has_mega_role?, #link_if_can, #link_if_can_create, #link_if_can_destroy, #link_if_can_edit, #link_if_can_index, #link_if_can_show, #link_if_can_update, #link_if_can_with_wrapper
Instance Method Details
#_params ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/mega_bar/application_controller.rb', line 25 def _params permits = [] permits << 'controller' permits << 'page' permits << 'sort' permits << 'direction' permits << 'id' # Always permit id parameter permits << 'action' # Always permit action parameter # Only query fields if we have a valid model ID if env[:mega_env] && env[:mega_env][:modle_id] MegaBar::Field.by_model(env[:mega_env][:modle_id]).order('data_type desc').each do |att| case att.data_type when 'array' permits << { att.field => [] } else permits << att.field unless ['id', 'created_at', 'updated_at', :id].include?(att) permits << att.field + '___filter' end end end if params[controller_name.singularize] @p_params = params.require(controller_name.singularize).permit(permits) else @p_params = params.permit(permits) end end |
#env ⇒ Object
54 55 56 |
# File 'app/controllers/mega_bar/application_controller.rb', line 54 def env request.env end |