title: Rails 5.1 Routes: dynamic :action parameters
body: <p>Rails 5.0.0.beta4 introduced a deprecation warning on routes containing dynamic :action and :controller segments: </p>
  
  <pre><code>DEPRECATION WARNING: Using a dynamic :action segment in a route is deprecated and will be removed in Rails 5.1. 
  </code></pre>
  
  <p><a href="https://github.com/rails/rails/pull/23980">The commit message from this PR</a> states: </p>
  
  <blockquote>
    <p>Allowing :controller and :action values to be specified via the path
    in config/routes.rb has been an underlying cause of a number of issues
    in Rails that have resulted in security releases. In light of this
    it's better that controllers and actions are explicitly whitelisted
    rather than trying to blacklist or sanitize 'bad' values.</p>
  </blockquote>
  
  <p>How would you go about "whitelisting" a set of action parameters? I have the following in my routes file, which are raising the deprecation warning: </p>
  
  <pre><code>namespace :integrations do
    get 'stripe(/:action)', controller: 'stripe', as: "stripe"
    post 'stripe/deactivate', controller: 'stripe', action: 'deactivate'
  end
  </code></pre>