title: How do I have route helpers use existing params?
body: <p>Sometimes I won't have to provide a param to a route helper and it automagically pulls it in from the existing params. I can't seem to figure out how to get it to consistently work.</p>
  
  <p>routes.rb:</p>
  
  <pre><code>  scope ':admin_id', module: :admin do
      resources :roles
    end
  </code></pre>
  
  <p>When rendering a page where the <code>:admin_id</code> is set to <code>10</code>:</p>
  
  <pre><code>&lt;%= roles_path %&gt;                             # /10/roles
  &lt;%= edit_role_path(my_role, admin_id: 10) %&gt;  # /10/roles/15/edit
  &lt;%= edit_role_path(my_role) %&gt;                # sometimes works
  </code></pre>
  
  <p>rails
  routes:</p>
  
  <pre><code>     roles GET      /:admin_id/roles(.:format)                                                                roles#index
             POST     /:admin_id/roles(.:format)                                                                roles#create
    new_role GET      /:admin_id/roles/new(.:format)                                                            roles#new
   edit_role GET      /:admin_id/roles/:id/edit(.:format)                                                       roles#edit
        role GET      /:admin_id/roles/:id(.:format)                                                            roles#show
             PATCH    /:admin_id/roles/:id(.:format)                                                            roles#update
             PUT      /:admin_id/roles/:id(.:format)                                                            roles#update
             DELETE   /:admin_id/roles/:id(.:format)                                                            roles#destroy
  </code></pre>