title: unable to sign up with json devise
body: <p>I have a problem with Devise registration using /users/sign_up. I have to pass the registration details via rails terminal using curl like this: </p>
  
  <pre><code>curl: //your-domain:3000/users/sign_up --data "email=jump@gmail.com&amp;password=123456789&amp;password_confirmation=123456789"
  </code></pre>
  
  <p>and it should return:</p>
  
  <pre><code>{"success":true,"info":"Registered","email":"jump@example.com","auth_token":"N8N5MPqFNdDz3G1jRsC9"}
  </code></pre>
  
  <p>But I am getting below error message: </p>
  
  <pre><code>ActionController::RoutingError (No route matches [POST] "/users/sign_up"):
  </code></pre>
  
  <p>While users/sign_in is working perfectly:</p>
  
  <pre><code>curl: //your-domain:3000/users/sign_in.json --data "email=abc@gmail.com&amp;password=123456789"
  </code></pre>
  
  <p>return: </p>
  
  <pre><code>{"success":true,"info":"Logged in","auth_token":"czzBpiNS7mkkQJAbHyMo","email":"abc@gmail.com"}
  </code></pre>
  
  <hr>
  
  <p>Below is my  RegistrationsController class:</p>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
  
  before_filter :authenticate_user!, :except =&gt; [:create], :if =&gt; Proc.new { |c| c.request.format == 'application/json' }
    respond_to :json
  
    prepend_view_path 'app/views/devise'
  
    def create
      build_resource
      if resource.save
        sign_in resource
        resource.ensure_authentication_token!
        render :status =&gt; 200,
               :json =&gt; { :success =&gt; true,
                          :info =&gt; "Registered",
                          :email =&gt; resource.email,
                          :auth_token =&gt; resource.authentication_token }
      else
        render :status =&gt; :unprocessable_entity,
               :json =&gt; { :`enter code here`success =&gt; false,
                          :info =&gt; resource.errors }
      end
    end
  
  end
  </code></pre>
  
  <hr>
  
  <p>and routes.rb: has following settings:</p>
  
  <pre><code> devise_for(:users, :controllers =&gt; { :sessions =&gt; "sessions", :registrations =&gt; 'registrations' })
  </code></pre>