Skip to content

Instantly share code, notes, and snippets.

@subosito
Created February 7, 2013 02:53
Show Gist options
  • Save subosito/4728020 to your computer and use it in GitHub Desktop.
Save subosito/4728020 to your computer and use it in GitHub Desktop.
devise ajax
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index e69156d..6b328d3 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -56,6 +56,7 @@ Devise.setup do |config|
# If http headers should be returned for AJAX requests. True by default.
# config.http_authenticatable_on_xhr = true
+ config.http_authenticatable_on_xhr = false
# The realm used in Http Basic Authentication. "Application" by default.
# config.http_authentication_realm = "Application"
@@ -198,6 +199,7 @@ Devise.setup do |config|
#
# The "*/*" below is required to match Internet Explorer requests.
# config.navigational_formats = ["*/*", :html]
+ config.navigational_formats = [:html, :json]
# The default HTTP method used to sign out a resource. Default is :delete.
config.sign_out_via = :get
@@ -229,4 +231,4 @@ Devise.setup do |config|
# When using omniauth, Devise cannot automatically set Omniauth path,
# so you need to do it manually. For the users scope, it would be:
# config.omniauth_path_prefix = "/my_engine/users/auth"
-end
\ No newline at end of file
+end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment