title: Rails 4 force default route parameter to be included in generated URL
body: <p>I'm wrestling with routing and default values for optional parameters. Given the route:</p>
  
  <pre><code>    get '/product/:key(/:env(/:version))', to: 'delivery#widget_view',
      defaults: { env: 'live' }, as: :product_view
  </code></pre>
  
  <p>I understand if I give it a <strong>version</strong>, then I should have to give it an <strong>env</strong> as well. When I </p>
  
  <pre><code>link_to 'view it', key: 'mykey', env: 'live', version: 6
  </code></pre>
  
  <p>The resulting URL is</p>
  
  <pre><code>/product/mykey/6
  </code></pre>
  
  <p>And then that ends up creating <strong>params[env] = 6</strong>, and no value for <strong>version</strong></p>
  
  <p>If I remove the defaults or make :env required by removing (), 'live' is explicitly included in the generated URL. This my solution for now, but is there someway to have Rails give me :env when I supply :version?</p>