小编har*_* mg的帖子

如何调试未定义的方法 form_with 错误

我收到错误:

undefined form_with for #<#<Class:0x7ac62e0>:0x551e5a8> in articles#new

错误发生在以下文件中:new.html.erb 其中具有:

<%= form_with(model: [@article] , local: true) do |f| %>
  <p>
    <%= f.label :title %><enter code here`br>
    <%= f.text_field :title %>
  </p>
Run Code Online (Sandbox Code Playgroud)

控制器articles_controller.rb具有:

class ArticlesController < ApplicationController
  def new
  end
end
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails

6
推荐指数
1
解决办法
4825
查看次数

标签 统计

ruby-on-rails ×1