我正在尝试将 cocoon 用于嵌套 ajax 表单以及 formtastic
我的导轨版本
 Rails 3.2.3
我已将 gem "cocoon" 放入我的 gemfile 并进行了捆绑安装
然后在我的元素/_form.html.erb 中:
 <%= semantic_form_for @element do |f| %>
    <%= f.inputs do %>
    <%= f.input :projects, :label_method => :projectname%>
    <%= f.semantic_fields_for :experiments do |exp| %>
           <% render 'experiment_fields', :f => exp %>    
           <%= link_to_add_association "Add experiment", f, :experiments%>
    <%end%>   
    <% end %>
    <%= f.actions :submit, :cancel %>    
  <% end %>
与元素/_experiment_fields.html.erb :
 <div class='nested-fields'> 
   <%= f.input :exptype %>
   <%= link_to_remove_association "remove experiment", f %>
 </div>
这不会产生错误,但不会显示嵌套链接或表单
然后我添加到 assets/application.js:
   //= require cocoon
和 layout/application.html.erb
          <%= javascript_include_tag :cocoon %>
这会产生错误:
        couldn't find file 'cocoon'
我在茧安装中错过了什么吗?有人可以帮忙吗?