加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 使用路由约束时设计错误

发布时间:2020-12-17 01:55:29 所属栏目:百科 来源:网络整理
导读:我正在使用Devise进行身份验证.我有一个约束内的路线. 当这条路线被击中时,我得到一个错误,即Devise的变量未定义. 的routes.rb Rails.application.routes.draw do constraints subdomain: 'www' do root to: "splash#index" end devise_for :users,controlle
我正在使用Devise进行身份验证.我有一个约束内的路线.

当这条路线被击中时,我得到一个错误,即Devise的变量未定义.

的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

错误:

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

任何Devise的URL路径都会发生此错误.我怎样才能解决这个问题?

解决方法

试着看看rake路线给你的东西. 路由问题的答案几乎总是存在.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读