ajax_nested_form 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,16 +2,16 @@ module AjaxNestedForm
2
2
  module Helpers
3
3
  module ViewHelper
4
4
 
5
- def link_to_remove_fields(name, f, container)
6
- f.hidden_field(:_destroy) + link_to_function(name, "AjaxNestedForm.removeFields(this, \"#{container}\")".html_safe)
5
+ def link_to_remove_fields(name, f, container, html_options = {})
6
+ f.hidden_field(:_destroy) + link_to_function(name, "AjaxNestedForm.removeFields(this, \"#{container}\")".html_safe, html_options)
7
7
  end
8
8
 
9
- def link_to_add_fields(name, f, association, container, position = "last")
9
+ def link_to_add_fields(name, f, association, container, position = "last", html_options = {})
10
10
  new_object = f.object.class.reflect_on_association(association).klass.new
11
11
  fields = f.fields_for(association, new_object, :child_index => "new_#{association}") do |builder|
12
12
  render(association.to_s.singularize + "_fields", :f => builder)
13
13
  end
14
- link_to_function(name, "AjaxNestedForm.addFields(this, \"#{association}\", \"#{escape_javascript(fields)}\", \"#{container}\", \"#{position}\")".html_safe)
14
+ link_to_function(name, "AjaxNestedForm.addFields(this, \"#{association}\", \"#{escape_javascript(fields)}\", \"#{container}\", \"#{position}\")".html_safe, html_options)
15
15
  end
16
16
 
17
17
  end
@@ -1,3 +1,3 @@
1
1
  module AjaxNestedForm
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajax_nested_form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-23 00:00:00.000000000 Z
12
+ date: 2012-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: -611399917
143
+ hash: -679952099
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: -611399917
152
+ hash: -679952099
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.24