Skip to content
Browse files

Update README.md

  • Loading branch information...
1 parent b094dc9 commit c9545cccb75f8c799fdd150861183301b0cd14c3 @ncri committed Nov 11, 2013
Showing with 12 additions and 11 deletions.
  1. +12 −11 README.md
View
23 README.md
@@ -50,17 +50,6 @@ Links to add and remove fields can be added using the *add_nested_fields_link* a
= f.add_nested_fields_link :videos
Note that *remove_nested_fields_link* needs to be called within the *nested_fields_for* call and *add_nested_fields_link* outside of it via the parent builder.
-There are 4 javascipt events firing before and after addition/removal of the fields in the *nested_form_fields* namespace. Namely:
- fields_adding, fields_added, fields_removing, fields_removed
-
-CoffeeScript sample:
-
- $(document).bind "fields_added.nested_form_fields", (event,param) ->
- switch param.object_class
- when "video"
- console.log "Video object added"
- else
- console.log "INFO: Fields were successfully added, callback not handled."
You can change the link text of *remove_nested_fields_link* and *add_nested_fields_link* like this:
@@ -76,6 +65,18 @@ You can change the type of the element wrapping the nested fields using the *wra
The default wrapper element is a fieldset. To add legend element to the fieldset use:
= f.nested_fields_for :videos, legend: "Video" do |ff|
+
+There are 4 javascipt events firing before and after addition/removal of the fields in the *nested_form_fields* namespace. Namely:
+ fields_adding, fields_added, fields_removing, fields_removed.
+
+CoffeeScript sample:
+
+ $(document).on "fields_added.nested_form_fields", (event,param) ->
+ switch param.object_class
+ when "video"
+ console.log "Video object added"
+ else
+ console.log "INFO: Fields were successfully added, callback not handled."
## Contributing

0 comments on commit c9545cc

Please sign in to comment.
Something went wrong with that request. Please try again.