ruby on rails - awesome_nested_fields not adding new not removing new elements of form -
rails newb here. i'm trying use awesome_nested_fields gem (https://github.com/lailsonbm/awesome_nested_fields) in simple tasks project. i've followed instructions found in link can't seem dynamic add or remove item work shown in demo here. i've been looking through demo source code , can't seem figure out doing incorrectly. updating existing task works fine. please let me know if need more code project.
here partial containing form:
<%= form_for(daily_list) |f| %> <div class="items"> <%= f.nested_fields_for :tasks |f| %> <fieldset class="item"> <%= f.label :title %> <%= f.text_field :title %> <%= f.label :body %> <%= f.text_field :body %> <a href="#" class="remove" data-confirm="are sure?">remove</a> <%= f.hidden_field :id %> <%= f.hidden_field :_destroy %> </fieldset> <% end -%> </div> <a href="#" class="add">add task</a> <div class="actions"> <%= f.submit "update tasks #{format_date(daily_list.date)}" %> </div>
the line i've added application.js file following (besides necessary require statements):
$(document).ready(function(e)) { $('form').nestedfields();
}
help please! thank :)
Comments
Post a Comment