Error detection when using route restriction

I use Devise for authentication. I have a route inside constraint.

When I hit this route, I get an error message indicating that the Devage variables are undefined.

routes.rb

Rails.application.routes.draw do
  constraints subdomain: 'www' do
    root to: "splash#index"
  end

  devise_for :users, controllers: { registrations: 'registrations', sessions: 'sessions' }

  # More routes are here...

end

Error:

undefined local variable or method `destroy_user_session_path' for #<#<Class:0x007fbd23022208>:0x007fbd35769c98>

This error occurs for any of the Devise URLs. How can i fix this?

+4
source share
1 answer

Try to see what gives rake routes. The answer to routing questions almost always exists.

0
source

Source: https://habr.com/ru/post/1599240/


All Articles