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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay