title: rails 3.1 mountable engines HTTP 404 Error on ajax post call
body: <p>I am building my first Rails 3.1 engines plugin in which i have controller called initiatives_controller and have a action know as upload whenever i try to make a call to upload action via jquery ajax "post" call its returning me 404 error I feel there is some issue in routes.rb because it used work in Rails 3.0</p>
  
  <p>My routes.rb looks like</p>
  
  <pre><code>Marcal::Engine.routes.draw do
     resources :media
     resources :initiatives
     post "initiatives/upload"
  end
  </code></pre>
  
  <p>My initiatives_controller.rb</p>
  
  <pre><code>class InitiativesController &lt; ApplicationController
     def upload
       puts "hiiiii"
       @medium = Medium.new(params[:medium])
       if @medium.save
          render :json =&gt; { 'status' =&gt; 'success' }
       else
          render :json =&gt; { 'status' =&gt; 'error' }
       end
    end
  </code></pre>
  
  <p>end
  end</p>
  
  <p>And i used do ajax call as below</p>
  
  <pre><code>          $.ajax({
              url: "/initiatives/upload",
              type: "POST",
              data: "medium=something"
              dataType: "json",
              success: function(sucessdata)
              {
                alert("success");
              }
  
           });      
  </code></pre>
  
  <p>end</p>