I am trying to use cocoon for ajax nested form in combination with formtastic
my rails version
Rails 3.2.3
I put the cocoon gem in my gemfile and installed the package
then in my /_form.html.erb elements:
<%= 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 %>
with elements /_experiment_fields.html.erb:
<div class='nested-fields'> <%= f.input :exptype %> <%= link_to_remove_association "remove experiment", f %> </div>
this does not cause an error, but does not display a sublink or form
i is then added to assets / application.js:
//= require cocoon
and in layout / application.html.erb
<%= javascript_include_tag :cocoon %>
this generates an error:
couldn't find file 'cocoon'
Did I miss something in the installation of the cocoon? can anyone help?
source share