title: AbstractController::ActionNotFound error, even though routes.rb is configured
body: <p>I have a <code>UserController</code> with these methods:</p>
  
  <pre><code>class UserController &lt; ApplicationController
    # snip
  
    def test_add_realtime_code
    end
  
    def add_realtime_code
      if request.post?
        # snip
      end
    end
  end
  </code></pre>
  
  <p>In my <code>routes.rb</code>, I have this:</p>
  
  <pre><code>match '/user/add_realtime_code', :controller =&gt; 'user', :action =&gt; 'add_realtime_code', :via =&gt; :post
  </code></pre>
  
  <p>In <code>/user/test_add_realtime_code.html.erb</code>, I have a button that sends an AJAX POST request to <code>/user/add_realtime_code</code>:</p>
  
  <pre><code>&lt;div&gt;
    &lt;script&gt;
      $(document).ready(function() {
        $('#test_button').click(function() {
          $.ajax({
            type: 'POST',
            url: '/user/add_realtime_code',
            dataType: 'text',
            data: { /* snip */ },
            success: function(data, textStatus, jqXHR) {
              $('#result').html(textStatus + ': ' + data);
            }
          });
        });
      });
    &lt;/script&gt;
    &lt;input type="button" name="test_button" id="test_button" value="test"&gt;&lt;/input&gt;
    &lt;div id="result"&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Even though I have the route set up in <code>routes.rb</code>, whenever I click on the button and send the AJAX request, I get this error:</p>
  
  <pre><code>AbstractController::ActionNotFound (The action 'add_realtime_code' could not be found for UserController)
  </code></pre>
  
  <p>What do I need to change?</p>