无法使用nested_form_for gem

我是第一次使用nested_form_for gem。我不知道这是一个问题,或者我使用它是错误的,但我得到一个“未定义的方法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包含后包含在我的布局中的nested_form.js文件(
<%= javascript_include_tag :default, 'nested_form' %>
)。 谁也使用这个宝石? 谢谢!     
已邀请:
一切看起来都正确,如果发电机运行宝石应该到位。自从将插件添加到Gemfile后,您是否重新启动了服务器?     

要回复问题请先登录注册