我正在开发一个新的rails项目,并且在我的本地主机开发环境中遇到了这个错误:
protect_from_forgery with: :exception我的应用程序助手文件:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
end您知道如何规避和/或解决此错误吗?
需要注意的是,这种情况发生在
http://localhost:3000/pages/home但不是
http://localhost:3000
这是我的应用程序跟踪:
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 skipshttps://stackoverflow.com/questions/47783612
复制相似问题