In app with (Gemfile ):
gem "devise", ">= 2.1.2"
gem 'rails', '3.2.8'
gem 'jquery_mobile_rails'
Before add jquery-mobile, all works fine, when enter invalidad data i got the page with a error message and log :
Started POST "/users/sign_in" for 127.0.0.1 at 2012-11-28 12:01:13 -0500
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"jLtHS2q0wO+tgswm9VM2/EiuTiq7J9Wwp8d65t/RSGE=", "user"=>{"email"=>"", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Completed 401 Unauthorized in 0ms
Processing by Devise::SessionsController#new as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"jLtHS2q0wO+tgswm9VM2/EiuTiq7J9Wwp8d65t/RSGE=", "user"=>{"email"=>"", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Rendered devise/shared/_links.html.erb (0.8ms)
Rendered devise/sessions/new.html.erb within layouts/application (3.2ms)
Rendered layouts/_navigation.html.erb (0.5ms)
Rendered layouts/_messages.html.erb (0.0ms)
Completed 200 OK in 29ms (Views: 28.9ms)
After add jquery-mobile, when login with correct data works fine, but with invalid data i get 401 and dont redirect noting . In the http response (view with firebug ) show only the message with the error like “invalid email” (not html code nor json) and jquery-mobile show “Error loading page”.
Started POST "/users/sign_in" for 127.0.0.1 at 2012-11-27 21:32:45 -0500
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"EYx56pui4v6trcuzmXQuhzY2BDHwqrADepKuySx9ub0=", "user"=>{"email"=>"test@test.net", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Completed 401 Unauthorized in 0ms
I have default devise controller and default views generated.
How handle errors message of devise with jquery mobile ?
Only not use ajax with jquery-mobile and devise for default.
In
config/initializers/devise.rb