cool_nested_forms 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b48184d7b170609c8a71ea4eb082cfb6edfd795f
4
- data.tar.gz: 52b40bc7014dfec757f6f34753e5b4afbdfd77e7
3
+ metadata.gz: af501a2bfc55ecb63e39851038dfb7d0bba6614e
4
+ data.tar.gz: 594c8c6a3b576f6e836489ef47a53991e190d4b9
5
5
  SHA512:
6
- metadata.gz: e0527b621ff6b2ca7dc633c996ed48fbf22de4d2afe22e5d12348af1e43f32f82d2e95f69b7533e81455ee39361d1dab1df5d7d8f7bae96a68cd9892d3ad4bd7
7
- data.tar.gz: 85ff8543fd00f3ac6463c5e2e3899d4570ac0152d619a519cc8c67a7eca0d87aad0872c7a22315aeae51d8b5a6f1e4ec1525ffeb3dace99759b20586dbcd3016
6
+ metadata.gz: 5508c12b75229896af14311249e770ee2303e398e30d5b4c7101dc525a506f0ead853644e51a1d8560d705c4d1f50c996f8d41758d74aeeaab2a4280a51ad3ac
7
+ data.tar.gz: b2b35b327d07736004e495567c90b0fd35c7a13db4999f247b0ebdcb824f1ee3b48bf83ca3d3b9516f06a12e91ebebc1aa1849f3018d8237d9fa5c605a3cc523
@@ -10,7 +10,7 @@ $(function(){
10
10
  var regexp_parent_new_field = new RegExp('new_' + association, 'g');
11
11
  var new_id = new Date().getTime();
12
12
  var Dest = (target == '') ? $(this).parent() : $('#'+target);
13
- Dest.append(window[ template +'_fields'].replace(regexp, new_id).replace(regexp2, new_id));
13
+ Dest.append(window[ template ].replace(regexp, new_id).replace(regexp2, new_id));
14
14
  for(var index in child_templates)
15
15
  {
16
16
  child_template = child_templates[index];
@@ -2,8 +2,8 @@ module CoolNestedFormsHelper
2
2
 
3
3
  def new_fields_template(f,association,options={})
4
4
  options[:object] ||= f.object.class.reflect_on_association(association).klass.new
5
- options[:partial] ||= association.to_s.singularize+"_fields"
6
- options[:template] ||= association.to_s+"_fields"
5
+ options[:partial] ||= association.to_s.singularize
6
+ options[:template] ||= association.to_s
7
7
  options[:child_template_options] ||= []
8
8
  options[:f] ||= f
9
9
 
@@ -14,13 +14,13 @@ module CoolNestedFormsHelper
14
14
  options[:child_template_options].each do |child|
15
15
  child_tmpl += new_fields_template(b,child[:association],child)
16
16
  end
17
- child_tmpl = child_tmpl.gsub /\r?\n|\r/, ' '
17
+ child_tmpl = child_tmpl.gsub( /\r?\n|\r/, ' ')
18
18
  end
19
19
  render(:partial=>options[:partial],:locals =>{:f => b})
20
20
  end
21
21
  end
22
22
 
23
- tmpl = tmpl.gsub /\r?\n|\r/, ' '
23
+ tmpl = tmpl.gsub( /\r?\n|\r/, ' ')
24
24
  script = "<script> var #{options[:template]} = '#{tmpl.to_s}'; </script>"
25
25
  script += child_tmpl
26
26
  return script.html_safe
@@ -1,3 +1,3 @@
1
1
  module CoolNestedForms
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -2,6 +2,6 @@ require "cool_nested_forms/version"
2
2
  require "cool_nested_forms/engine"
3
3
 
4
4
  module CoolNestedForms
5
- class Engine < Rails::Engine
5
+ class Engine < Rails::Engine
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cool_nested_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Roque
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-23 00:00:00.000000000 Z
11
+ date: 2018-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails