DEV Community

wusher
wusher

Posted on • Originally published at wusher.github.io on

Feature Flags On Rails Routes

Found a tweet explaining how to wrap a rails route with a feature flag.

resources :media,
      constraints: ->(req) do
                     current_user = req.env["warden"].user(:user)
                     Flipper.enabled?(:media_uploads, current_user)
                   end

Enter fullscreen mode Exit fullscreen mode

Source: https://twitter.com/carbon\_noreply/status/1565244390666252288

Top comments (0)