title: Rails: No route matches error - due to constraints?
body: <p>I'm getting the error:</p>
  
  <pre><code>ActionController::RoutingError at /websites
  No route matches {:controller=&gt;"searches", :action=&gt;"domain_results"}
  </code></pre>
  
  <p>when trying to use the following link helper:</p>
  
  <pre><code>&lt;%= link_to website.domain, domain_results_path(website.domain) %&gt;
  </code></pre>
  
  <p>I have domain_results defined in my searches controller and the following route set up:</p>
  
  <pre><code>get 'search/:domain/domain' =&gt; 'searches#domain_results', as: :domain_results, constraints: { domain: /.*/ }
  </code></pre>
  
  <p>rake routes:</p>
  
  <pre><code>domain_results GET    /search/:domain/domain(.:format)    searches#domain_results {:domain=&gt;/.*/}
  </code></pre>
  
  <p>If I use the following it works:</p>
  
  <pre><code>&lt;%= link_to website.domain, "/search/#{website.domain}/domain" %&gt;
  
  get 'search/:project/project' =&gt; 'searches#project_results', as: :project_results
  &lt;%= link_to website.domain, project_results_path(rental.project) %&gt;
  </code></pre>
  
  <p>Is this due to the constraint I'm using? I had to use the constraints as I'm passing strings such as "google.com.au" into the path.</p>