初めてnested_form_forgemを使用しています。これが問題なのか、間違って使用しているのかはわかりませんが、「未定義のメソッドnested_form_for」エラーが発生します。あなたが見ることができるように私はかなり規則的な形を持っています:
<%= nested_form_for @user do |f| %>
<%= f.fields_for :godfathers do |godfather_form| %>
<%= godfather_form.label :name %> <br/>
<%= godfather_form.text_field :name %> <br/>
<%= godfather_form.label :description %> <br/>
<%= godfather_form.text_field :description %> <br/>
<%= godfather_form.link_to_remove "Remove this godfather" %>
<% end %>
<%= f.link_to_add "Add a godfather", :godfathers %>
<% end %>
ちなみに、私はgemをインストールし、:を実行してrails generate nested_form:install command
、jquery include()の後にレイアウトに含めたnested_form.jsファイルを生成しました<%= javascript_include_tag :default, 'nested_form' %>
。
この宝石を使っている人はいますか?
ありがとう!