public
Rubygem
Description: rails multi-model forms made easy!
Homepage: http://jamesgolick.com/attribute_fu
Clone URL: git://github.com/giraffesoft/attribute_fu.git
search for parent to remove in remove_link using $.parents, not $.parent 
(Gopal Patel)
giraffesoft (author)
Mon Jun 02 05:45:22 -0700 2008
commit  775a729d6e7508be891ccde9152f33369f2cd98d
tree    02c5ef0ea80f77f5ea787b1c555557a8d5313430
parent  a105310c979547a0fb614ce3d082eec971b78ec1
...
54
55
56
57
 
58
59
60
...
54
55
56
 
57
58
59
60
0
@@ -54,7 +54,7 @@ module AttributeFu
0
       css_selector = options.delete(:selector) || ".#{@object.class.name.split("::").last.underscore}"
0
       function = options.delete(:function) || ""
0
       
0
- function << "$(this).parent(&quot;#{css_selector}&quot;).remove()"
0
+ function << "$(this).parents(&quot;#{css_selector}&quot;).remove()"
0
       
0
       @template.link_to_function(name, function, *args.push(options))
0
     end
...
76
77
78
79
 
80
81
82
...
86
87
88
89
 
90
91
92
...
97
98
99
100
 
101
102
103
...
76
77
78
 
79
80
81
82
...
86
87
88
 
89
90
91
92
...
97
98
99
 
100
101
102
103
0
@@ -76,7 +76,7 @@ class AssociatedFormHelperTest < Test::Unit::TestCase
0
       end
0
 
0
       should "infer the name of the current @object in fields_for" do
0
- assert_match "$(this).parent(&quot;.comment&quot;).remove()", @erbout
0
+ assert_match "$(this).parents(&quot;.comment&quot;).remove()", @erbout
0
       end
0
     end
0
     
0
@@ -86,7 +86,7 @@ class AssociatedFormHelperTest < Test::Unit::TestCase
0
       end
0
 
0
       should "use the alternate selector" do
0
- assert_match "$(this).parent(&quot;.blah&quot;).remove()", @erbout
0
+ assert_match "$(this).parents(&quot;.blah&quot;).remove()", @erbout
0
       end
0
     end
0
     
0
@@ -97,7 +97,7 @@ class AssociatedFormHelperTest < Test::Unit::TestCase
0
       end
0
 
0
       should "still infer the name of the current @object in fields_for, and create the function as usual" do
0
- assert_match "$(this).parent(&quot;.comment&quot;).remove()", @erbout
0
+ assert_match "$(this).parents(&quot;.comment&quot;).remove()", @erbout
0
       end
0
       
0
       should "append the secondary function" do

Comments

    No one has commented yet.