title: Ajax routes in Rails 3
body: <p>In my Rails 2.3 application, the following routes were working properly</p>
  
  <pre><code>map.ajax 'ajax', :controller =&gt; 'widgetresponse_controller'   , :action =&gt; 'getWidgetJson'
  </code></pre>
  
  <p>When I migrated to Rails 3,<br>
  I tried a number of new routes, to get this working but none of them worked.  </p>
  
  <p>1.</p>
  
  <pre><code>match 'ajax' =&gt; 'widgetresponse#getWidgetJson', :as =&gt; :ajax
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>match 'ajax' =&gt; 'widgetresponse_controller#getWidgetJson', :as =&gt; :ajax
  </code></pre>
  
  <p>3.</p>
  
  <pre><code>get 'widgetresponse/getWidgetJson', :as =&gt; :ajax
  </code></pre>
  
  <p>4.</p>
  
  <pre><code>get 'widgetresponse/getWidgetJson'
  </code></pre>
  
  <p>Its a very basic question to ask, but I don't know what I am doing wrong.</p>