mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
This enables showing features to individual users only, which enables us to deploy features that are not yet released to gather feedback from product and testing, while no users have access to it.
28 lines
774 B
Ruby
28 lines
774 B
Ruby
module ApplicationHelper
|
|
def feature?(feature, user = nil)
|
|
OpenFoodNetwork::FeatureToggle.enabled?(feature, user)
|
|
end
|
|
|
|
def ng_form_for(name, *args, &block)
|
|
options = args.extract_options!
|
|
|
|
form_for(name, *(args << options.merge(builder: AngularFormBuilder)), &block)
|
|
end
|
|
|
|
# Pass URL helper calls on to spree where applicable so that we don't need to use
|
|
# spree.foo_path in any view rendered from non-spree-namespaced controllers.
|
|
def method_missing(method, *args, &block)
|
|
if method.to_s.end_with?('_path', '_url') && spree.respond_to?(method)
|
|
spree.public_send(method, *args)
|
|
else
|
|
super
|
|
end
|
|
end
|
|
|
|
def body_classes
|
|
classes = []
|
|
classes << "off-canvas" unless @hide_menu
|
|
classes << @shopfront_layout
|
|
end
|
|
end
|