首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >protect_from_forgery with::exception rails 5

protect_from_forgery with::exception rails 5
EN

Stack Overflow用户
提问于 2017-12-13 08:12:23
回答 0查看 1K关注 0票数 0

我正在开发一个新的rails项目,并且在我的本地主机开发环境中遇到了这个错误:

代码语言:javascript
复制
protect_from_forgery with: :exception

我的应用程序助手文件:

代码语言:javascript
复制
 class ApplicationController < ActionController::Base
  protect_from_forgery with: :exception
end

您知道如何规避和/或解决此错误吗?

需要注意的是,这种情况发生在

代码语言:javascript
复制
http://localhost:3000/pages/home

但不是

http://localhost:3000

这是我的应用程序跟踪:

代码语言:javascript
复制
artwe@DESKTOP-9MER9I4 /c/sites/cookies (master)
$ rails --trace
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
** Execute default
Run options: --seed 1992

# Running:

E

Error:
PagesControllerTest#test_should_get_home:
AbstractController::Helpers::MissingHelperError: Missing helper file helpers/c:/sites/cookies/app/helpers/application_helper.rb_helper.rb
    app/controllers/application_controller.rb:1:in `<top (required)>'
    app/controllers/pages_controller.rb:1:in `<top (required)>'
    test/controllers/pages_controller_test.rb:5:in `block in <class:PagesControllerTest>'


bin/rails test test/controllers/pages_controller_test.rb:4



Finished in 1.552152s, 0.6443 runs/s, 0.0000 assertions/s.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47783612

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档