Module: Controller::FeatureFlagsConcern

Extended by:
ActiveSupport::Concern
Included in:
Resource::BaseController, Service::BaseController
Defined in:
app/controllers/concerns/controller/feature_flags_concern.rb

Overview

Adds an api to toggle features at controller level.

Assume you have ransack enabled globally (Itsf::Backend.features?(:ransach) == true), but you can’t use ransack in a specific controller, than you overwrite disabled_features in the controller and make it return an array with :ransack inside of it:

def disabled_features

[:ransack]

end

Then you can ask features?(:ransack) in the view and it will return false, although ransack is enabled globally.