Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4104634
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:08:35+00:00 2026-05-20T21:08:35+00:00

I upgraded to Rails 3.0.5 & Devise 1.1.8. When I try to delete any

  • 0

I upgraded to Rails 3.0.5 & Devise 1.1.8. When I try to delete any object (through a view with :remote => true), I get an authentication dialog and the Devise session is destroyed. Then, I have to login again, and the object is still there… does anyone else have this problem? Any ideas on how to solve it?

Thank you very much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T21:08:36+00:00Added an answer on May 20, 2026 at 9:08 pm

    This problem is not related to Devise. In short, since Rails 3.0.4 it is required that every non-GET request should have CSRF token, otherwise session gets cleared.

    There are two major changes in this
    fix, the behaviour when CSRF
    protection fails has changed and the
    token will now be required for all
    non-GET requests.

    After applying this patch failed CSRF
    requests will no longer generate HTTP
    500 errors, instead the session will
    be reset
    . Users can override this
    behaviour by overriding
    handle_unverified_request in their own
    controllers.

    More details here: http://weblog.rubyonrails.org/2011/2/8/csrf-protection-bypass-in-ruby-on-rails

    jQuery snippet to use with your AJAX requests

    $(document).ajaxSend(function(e, xhr, options) {
      var token = $("meta[name='csrf-token']").attr("content");
      xhr.setRequestHeader("X-CSRF-Token", token);
    });
    

    If you’re using prototype, you’ll need the following code:

    Ajax.Responders.register({
      onCreate: function(request) {
        var csrf_meta_tag = $$('meta[name=csrf-token]')[0];
    
        if (csrf_meta_tag) {
          var header = 'X-CSRF-Token',
              token = csrf_meta_tag.readAttribute('content');
    
          if (!request.options.requestHeaders) {
            request.options.requestHeaders = {};
          }
          request.options.requestHeaders[header] = token;
        }
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently upgraded my gemfile to try and get Rails 3.1 working with
I upgraded the authentication in my application to use Rails 3.1's has_secure_password facility. In
I just upgraded to Rails 2.3.2.1 running Litespeed web server 4.0.5 and get the
I just upgraded to Rails 3.2.0 and get this error after signing up to
Upgraded to Rails 2.3.2 and Passenger 2.2.4 on Ubuntu hardy slice at slicehost with
I just upgraded from Rails 3.0.3 to 3.2.1. The upgrade went smoothly on my
In my rails application I have upgraded in the past from rails 3.0 to
We just upgraded our app to Rails 3.2.2 and are now having a routing
I recently upgraded to Lion and I am trying to install Rails. I used
This all worked fine in rails 2.3.5, but when a contractor firm upgraded directly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.