title: Rails JSON url encoding does not parse .json/.xml
body: <p>I have the following rails route</p>
  
  <pre><code>resources :apps do
    post "name/:text/,
       :on =&gt; :member, :action =&gt; :register, :as =&gt; :register,
       :text =&gt; /[^\/]+/
  
  end
  </code></pre>
  
  <p>The url that hits it in json format is the following:</p>
  
  <pre><code>curl -v -s -H "Content-type: application/json" -d '' -X POST http://0.0.0.0:3000/apps/1/name/hello.json
  </code></pre>
  
  <p>When my rails controller receives the request above, it can't see that the <code>.json</code> at the end of the url is part of the url encoding/extension and not part of hello. It sees the params as the following:</p>
  
  <pre><code>Parameters: {"id"=&gt;"1", "text"=&gt;"hello.json"}
  </code></pre>
  
  <p>instead of having <code>"text" =&gt; "hello"</code>. </p>
  
  <p>I also have <code>respond_to :json</code> in my AppsController.</p>
  
  <p>Any idea why this happens? and how to make rails parse the <code>.json</code> out?</p>