I get the following error when I try to exit a development error:
No route match [GET] "/ d / users / sign_out"
My tag is correct, it looks like this:
<%= link_to "Sign Out", destroy_session_path, :method=>:delete %>
My development route:
devise_for :users, :path_prefix=>"d", :controllers=>{:sessions=>"sessions"}
Other routes:
resources :users
Using custom controller sessions to log in to ajax, for example, on the Devise wiki page:
class SessionsController < Devise::SessionsController def create respond_to do |format| format.html{ super } format.json do resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#failure") #resource = warden.authenticate!(:scope => resource_name, :recall => :failure) return sign_in_and_redirect(resource_name, resource) end end end def sign_in_and_redirect(resource_or_scope, resource=nil) scope = Devise::Mapping.find_scope!(resource_or_scope) resource ||= resource_or_scope sign_in(scope, resource) unless warden.user(scope) == resource return render :json => {:success => true, :redirect => stored_location_for(scope) || after_sign_in_path_for(resource)} end def failure return render:json => {:success => false, :errors => ["Login failed."]} end end
The development initializer has:
config.sign_out_via = :delete
Any ideas on what might cause the problem? I searched Google and is still at a dead end.
Update:
Here is a screenshot of the rails routes file for developers. Sorry, it's small, but you can right-click and then view it separately for a larger screen.

Update # 2:
The jquery_ujs file is included.
Update No. 3:
The console shows that the deletion is actually being transmitted, but it jumps from session_controller to / then to d / users / sign_out ... You donβt know how to fix it.
Update # 4:
When redirecting, it first goes to d / users / sign_out as DELETE, as it should. It then redirects to root_url
, which then throws an error ERROR Errno::ECONNABORTED: An established connection was aborted by the software in your host machine.
Then it tries to redirect d / users / sign_out as GET, where it does not work.