title: Getting 404 error post data after reaches controller action in rails
body: <p>I have been trying to post data to controller action in RAILS application development. When i post data through form, POST data reaches specific controller action defined in routes.rb. But it gives back with 404 error.</p>
  
  <p>Here is code:</p>
  
  <p>Controller-></p>
  
  <pre><code>class UserActivityController &lt; ApplicationController
  unloadable
  
  def index
     #Defining form
     @userActivity = UserActivity.new
  end
  
  def create
      puts "Helloo"
      @user_activity = UserActivity.new
      respond_to do |format|
        format.html # new.html.erb
        format.json { render json: @user_activity }
      end
  end
  </code></pre>
  
  <p>routes.rb -></p>
  
  <pre><code>match 'timesheet/create' =&gt; 'userActivity#create', :via =&gt; :post, :as=&gt;:create
  </code></pre>
  
  <p>and I tried with</p>
  
  <pre><code>post 'timesheet/create', :to =&gt; 'userActivity#create'
  </code></pre>
  
  <p>Form -></p>
  
  <pre><code>&lt;%= form_for @userActivity,:url =&gt; { :controller=&gt;"userActivity",:action =&gt; "create" }, :remote =&gt; true do |task| %&gt;
  [.....]
  &lt;% end %&gt;
  </code></pre>
  
  <p>Error :</p>
  
  <pre><code>Started POST "/timesheet/create" for 127.0.0.1 at 2015-07-19 11:12:58 +0530
  Processing by UserActivityController#create as JS
    Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"qsqRIGH8caCz4I25m1sFKviELHEYOWNUsiLYNnc1kP8=", "date"=&gt;"2015-07-19", "project"=&gt;"", "task"=&gt;{"detail"=&gt;""}, "time"=&gt;{"start(5i)"=&gt;"", "end(5i)"=&gt;""}, "issue"=&gt;"", "commit"=&gt;"Create"}
  Helloo
  Current user: XXX (id=XX)
  Missing template, responding with 404
    Rendered common/error.html.erb (0.6ms)
  Completed 404 Not Found in 7ms (Views: 1.8ms | ActiveRecord: 0.0ms)
  </code></pre>
  
  <p>Please help me to figure out this issue!.</p>