# File lib/nested_form/builder_mixin.rb, line 60 def link_to_remove(*args, &block) options = args.extract_options!.symbolize_keys options[:class] = [options[:class], "remove_nested_fields"].compact.join(" ") # Extracting "milestones" from "...[milestones_attributes][...]" md = object_name.to_s.match /(\w+)_attributes\]\[[\w\d]+\]$/ association = md && md[1] options["data-association"] = association args << (options.delete(:href) || "javascript:void(0)") args << options hidden_field(:_destroy) << @template.link_to(*args, &block) end