小编And*_*ues的帖子

使用 HAML 而不是 ERB 会导致测试失败

这看起来很基本,但我使用的是 Rails 5,我将所有视图都换成了 HAML 而不是 ERB。现在我的一项测试未能说出以下内容:

ActionController::UnknownFormat: ProductsController#index is missing  a template for this request format and variant.

request.formats: ["text/html"]
request.variant: []
    test/controllers/products_controller_test.rb:9:in `block in <class:ProductsControllerTest>'
Run Code Online (Sandbox Code Playgroud)

有什么地方可以更改默认值,还是我必须解决其他问题?我的路线很好,我可以访问索引页面没问题。

ruby haml ruby-on-rails erb ruby-on-rails-5

3
推荐指数
1
解决办法
1144
查看次数

标签 统计

erb ×1

haml ×1

ruby ×1

ruby-on-rails ×1

ruby-on-rails-5 ×1