I had to make the following changes to make this work:
configurations / Initializers / devise.rb
config.http_authenticatable_on_xhr = false If you make it false, otherwise jQuery mobile will send XHR requests to log in and you will get error 401.
config.navigational_formats = [:"*/*", "*/*", :html, :mobile]
Otherwise, it does not recognize the format. You think this will work with redirection, but in fact this does not happen. You need to do one more thing.
This hacked me, so I added: config / Initializers / devise_hack.rb
ActionController::Responder.class_eval do alias :to_mobile :to_html end
Now it works.
One more thing; in my .rb application I have this for mobylette to configure my mobile stuff:
respond_to_mobile_requests :skip_xhr_requests => false, :fall_back => :html
Between Responder.class_eval and :fall_back => :html you might think that this is not necessary. Most of the written configuration seems to be the same and duplicated. However, without all these settings, it simply does not work.
source share