Unprocessable Entity trying to register

422 views
Skip to first unread message

Prizefighter

unread,
Feb 8, 2013, 8:42:26 PM2/8/13
to plataforma...@googlegroups.com
I am using Devise with a javascript MVC framework (backbone). After collecting the form values for registration, I submitted them to the users.json url. However, I got a 422 Unprocessable Entity error from the Devise registrations controller. does anyone know why this might be?

Processing by Devise::RegistrationsController#create as JSON
  Parameters: {"email"=>"o...@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "registration"=>{"email"=>"o...@gmail.com", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"}}
   (0.1ms)  begin transaction
   (0.1ms)  rollback transaction
Completed 422 Unprocessable Entity in 38ms (Views: 0.3ms | ActiveRecord: 0.6ms)

Note, the more recent releases of Devise don't respond with JSON, so I'm using Devise 2.1.2


Michael Mitchell

unread,
Feb 8, 2013, 9:24:35 PM2/8/13
to plataforma...@googlegroups.com
This problem was fixed by including the backbone_rails_sync library from the backbone-rails gem, which allowed me to set a paramRoot: user




--
 
---
You received this message because you are subscribed to the Google Groups "Devise" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plataformatec-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

latortuga

unread,
Feb 11, 2013, 10:39:15 AM2/11/13
to plataforma...@googlegroups.com
You can setup more recent versions of Devise to respond to JSON by including a respond_to at the controller level to define which formats you accept. See the docs for respond_with here: http://apidock.com/rails/v3.2.8/ActionController/MimeResponds/respond_with
Reply all
Reply to author
Forward
0 new messages