cocooned 1.4.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocooned
4
+ module Tags # :nodoc:
5
+ autoload :Base, 'cocooned/tags/base'
6
+
7
+ autoload :Add, 'cocooned/tags/add'
8
+ autoload :Down, 'cocooned/tags/down'
9
+ autoload :Remove, 'cocooned/tags/remove'
10
+ autoload :Up, 'cocooned/tags/up'
11
+ end
12
+ end
@@ -0,0 +1,83 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocooned
4
+ module TagsHelper # :nodoc:
5
+ module DefaultLabel # :nodoc:
6
+ protected
7
+
8
+ def default_label
9
+ keys = default_label_i18n_keys.collect(&:to_sym) + [action.to_s.humanize]
10
+ I18n.t(keys.first, default: keys.drop(1))
11
+ end
12
+
13
+ def default_label_i18n_keys
14
+ i18n_namespaces.collect { |ns| "#{ns}.defaults.#{action}" }
15
+ end
16
+
17
+ def i18n_namespaces
18
+ %w[cocooned]
19
+ end
20
+
21
+ def action
22
+ self.class.name.demodulize.underscore
23
+ end
24
+ end
25
+
26
+ module AssociationLabel # :nodoc:
27
+ protected
28
+
29
+ def default_label_i18n_keys
30
+ super + i18n_namespaces.collect { |ns| "#{ns}.#{association}.#{action}" }
31
+ end
32
+
33
+ # Extract association name from form's object_name.
34
+ # Ex: 'items' from 'list[items_attributes][0]'
35
+ def association
36
+ matches = form.object_name.scan(/\[([^\]]+)\]\[[^\]]+\]\z/).flatten
37
+ return matches.first.delete_suffix('_attributes') if matches.size.positive?
38
+
39
+ form.object.class.to_s.tableize
40
+ end
41
+ end
42
+
43
+ module DataAttributes # :nodoc:
44
+ protected
45
+
46
+ def html_data
47
+ html_data_normalize(options.delete(:data) || {})
48
+ end
49
+
50
+ # Normalize keys as underscored symbol to ease future lookups (as we
51
+ # won't need to check for dashed or underscored option names everytime)
52
+ def html_data_normalize(data)
53
+ data.transform_keys { |key| key.to_s.underscore.to_sym }
54
+ end
55
+ end
56
+
57
+ module Renderer # :nodoc:
58
+ protected
59
+
60
+ def renderer
61
+ Association::Renderer.new(template, form, association, builder.build, renderer_options)
62
+ end
63
+
64
+ def renderer_options
65
+ extract_options(:locals, :partial, :form_name, :form_options)
66
+ end
67
+
68
+ def builder
69
+ Association::Builder.new(form.object, association, builder_options)
70
+ end
71
+
72
+ def builder_options
73
+ extract_options(:wrap_object, :force_non_association_create)
74
+ end
75
+
76
+ def extract_options(*names)
77
+ names.each_with_object({}) do |name, extracted|
78
+ extracted[name] = options.delete(name) if options.key?(name)
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocooned
4
- VERSION = '1.4.1'
4
+ VERSION = '2.0.0'
5
5
  end
data/lib/cocooned.rb CHANGED
@@ -1,6 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'cocooned/deprecation'
3
4
  require 'cocooned/railtie'
4
5
 
5
- module Cocooned
6
+ module Cocooned # :nodoc:
7
+ autoload :Association, 'cocooned/association'
8
+ autoload :Helpers, 'cocooned/helpers'
9
+ autoload :Tags, 'cocooned/tags'
10
+ autoload :TagsHelper, 'cocooned/tags_helper'
6
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocooned
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaël-Ian Havard
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-08-08 00:00:00.000000000 Z
12
+ date: 2023-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -17,7 +17,7 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: '5.0'
20
+ version: '6.0'
21
21
  - - "<="
22
22
  - !ruby/object:Gem::Version
23
23
  version: '7.1'
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: '5.0'
30
+ version: '6.0'
31
31
  - - "<="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '7.1'
@@ -46,132 +46,78 @@ dependencies:
46
46
  - !ruby/object:Gem::Version
47
47
  version: '2.1'
48
48
  - !ruby/object:Gem::Dependency
49
- name: jasmine
49
+ name: formtastic
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.2'
54
+ version: '4.0'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.2'
61
+ version: '4.0'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rake
64
- requirement: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- type: :development
70
- prerelease: false
71
- version_requirements: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- - !ruby/object:Gem::Dependency
77
- name: rspec
78
64
  requirement: !ruby/object:Gem::Requirement
79
65
  requirements:
80
66
  - - "~>"
81
67
  - !ruby/object:Gem::Version
82
- version: 3.10.0
68
+ version: '13.0'
83
69
  type: :development
84
70
  prerelease: false
85
71
  version_requirements: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: 3.10.0
75
+ version: '13.0'
90
76
  - !ruby/object:Gem::Dependency
91
- name: rspec-rails
77
+ name: rspec
92
78
  requirement: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: 5.0.0
82
+ version: '3.11'
97
83
  type: :development
98
84
  prerelease: false
99
85
  version_requirements: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: 5.0.0
104
- - !ruby/object:Gem::Dependency
105
- name: rubocop
106
- requirement: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- type: :development
112
- prerelease: false
113
- version_requirements: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- - !ruby/object:Gem::Dependency
119
- name: rubocop-performance
120
- requirement: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- type: :development
126
- prerelease: false
127
- version_requirements: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- - !ruby/object:Gem::Dependency
133
- name: rubocop-rails
134
- requirement: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
- type: :development
140
- prerelease: false
141
- version_requirements: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - ">="
144
- - !ruby/object:Gem::Version
145
- version: '0'
89
+ version: '3.11'
146
90
  - !ruby/object:Gem::Dependency
147
- name: rubocop-rake
91
+ name: rspec-rails
148
92
  requirement: !ruby/object:Gem::Requirement
149
93
  requirements:
150
94
  - - ">="
151
95
  - !ruby/object:Gem::Version
152
- version: '0'
96
+ version: '5.0'
153
97
  type: :development
154
98
  prerelease: false
155
99
  version_requirements: !ruby/object:Gem::Requirement
156
100
  requirements:
157
101
  - - ">="
158
102
  - !ruby/object:Gem::Version
159
- version: '0'
103
+ version: '5.0'
160
104
  - !ruby/object:Gem::Dependency
161
- name: rubocop-rspec
105
+ name: simple_form
162
106
  requirement: !ruby/object:Gem::Requirement
163
107
  requirements:
164
- - - ">="
108
+ - - "~>"
165
109
  - !ruby/object:Gem::Version
166
- version: '0'
110
+ version: '5.1'
167
111
  type: :development
168
112
  prerelease: false
169
113
  version_requirements: !ruby/object:Gem::Requirement
170
114
  requirements:
171
- - - ">="
115
+ - - "~>"
172
116
  - !ruby/object:Gem::Version
173
- version: '0'
174
- description: Easier nested form. Supports standard Rails forms, Formtastic and SimpleForm.
117
+ version: '5.1'
118
+ description: " Easier nested form in Rails with capabilities to add, remove, reorder
119
+ or limit nested items. Works with standard Rails form builder, Formtastic or SimpleForm,
120
+ and with or without jQuery. "
175
121
  email:
176
122
  - gael-ian@notus.sh
177
123
  - nathan@dixis.com
@@ -179,27 +125,46 @@ executables: []
179
125
  extensions: []
180
126
  extra_rdoc_files: []
181
127
  files:
182
- - History.md
128
+ - CHANGELOG.md
183
129
  - LICENSE
184
130
  - README.md
185
- - Rakefile
186
131
  - app/assets/javascripts/cocoon.js
187
132
  - app/assets/javascripts/cocooned.js
188
133
  - app/assets/stylesheets/cocoon.css
189
134
  - app/assets/stylesheets/cocooned.css
190
135
  - cocooned.gemspec
191
136
  - lib/cocooned.rb
192
- - lib/cocooned/association_builder.rb
137
+ - lib/cocooned/association.rb
138
+ - lib/cocooned/association/builder.rb
139
+ - lib/cocooned/association/renderer.rb
140
+ - lib/cocooned/deprecation.rb
193
141
  - lib/cocooned/helpers.rb
194
- - lib/cocooned/helpers/cocoon_compatibility.rb
195
- - lib/cocooned/helpers/deprecate.rb
142
+ - lib/cocooned/helpers/containers.rb
143
+ - lib/cocooned/helpers/tags.rb
144
+ - lib/cocooned/helpers/tags/add.rb
145
+ - lib/cocooned/helpers/tags/down.rb
146
+ - lib/cocooned/helpers/tags/remove.rb
147
+ - lib/cocooned/helpers/tags/up.rb
196
148
  - lib/cocooned/railtie.rb
149
+ - lib/cocooned/tags.rb
150
+ - lib/cocooned/tags/add.rb
151
+ - lib/cocooned/tags/base.rb
152
+ - lib/cocooned/tags/down.rb
153
+ - lib/cocooned/tags/remove.rb
154
+ - lib/cocooned/tags/up.rb
155
+ - lib/cocooned/tags_helper.rb
197
156
  - lib/cocooned/version.rb
198
- homepage: http://github.com/notus-sh/cocooned
157
+ homepage: https://github.com/notus-sh/cocooned
199
158
  licenses:
200
159
  - Apache-2.0
201
160
  metadata:
202
161
  allowed_push_host: https://rubygems.org
162
+ rubygems_mfa_required: 'true'
163
+ bug_tracker_uri: https://github.com/notus-sh/cocooned/issues
164
+ changelog_uri: https://github.com/notus-sh/cocooned/blob/main/CHANGELOG.md
165
+ homepage_uri: https://github.com/notus-sh/cocooned
166
+ source_code_uri: https://github.com/notus-sh/cocooned
167
+ funding_uri: https://opencollective.com/notus-sh
203
168
  post_install_message:
204
169
  rdoc_options: []
205
170
  require_paths:
@@ -208,15 +173,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
173
  requirements:
209
174
  - - ">="
210
175
  - !ruby/object:Gem::Version
211
- version: '2.5'
176
+ version: '2.6'
212
177
  required_rubygems_version: !ruby/object:Gem::Requirement
213
178
  requirements:
214
179
  - - ">="
215
180
  - !ruby/object:Gem::Version
216
181
  version: '0'
217
182
  requirements: []
218
- rubygems_version: 3.3.7
183
+ rubygems_version: 3.4.1
219
184
  signing_key:
220
185
  specification_version: 4
221
- summary: Unobtrusive Rails nested forms handling, with or without jQuery.
186
+ summary: Form builder agnostic handling of Rails nested forms
222
187
  test_files: []
data/History.md DELETED
@@ -1,283 +0,0 @@
1
- # Change History / Release Notes
2
-
3
- ## Version 2.0.0 (Not released yet)
4
-
5
- * Remove dependency to jQuery
6
-
7
- ## Version 1.4.0
8
-
9
- ### Breaking changes
10
-
11
- * Drop support for Rails < 5.0 and Ruby < 2.5
12
- * Pass the original browser event to all event handlers _via_ e.originalEvent. (See [jQuery Event object](https://api.jquery.com/category/events/event-object/)).
13
-
14
- ### New features
15
-
16
- * Add support for @hotwired/turbo
17
-
18
- ### Bug fixes and other changes
19
-
20
- * Prevent side effects on options passed to view helpers.
21
- * Use form builder to add the hidden `_destroy` field instead of `hidden_field`.
22
- * Update deprecation warnings to postpone compatibility drop with the original `cocoon` to 3.0 (instead of 2.0)
23
-
24
- ## Version 1.3.2
25
-
26
- * Compatibility with Mongoid 7+
27
-
28
- ## Version 1.3.1
29
-
30
- * Use UMD pattern to load the Cocooned module
31
- * Now publish packages on both rubygems.org and npmjs.com
32
-
33
- ## Version 1.3.0
34
-
35
- ### Breaking changes
36
-
37
- * Drop support for Rubinius, Ruby < 2.2 and Rails < 4.0
38
- * Drop support for custom wrapper class on item containers (originaly supported _via_ an option on `link_to_remove_association`).
39
-
40
- ### Deprecated
41
-
42
- The gem has been renamed to `cocooned`:
43
-
44
- * `link_to_add_association` has been renamed `cocooned_add_item_link`
45
- * Generated add links class `add_fields` has been renamed `cocooned-add`
46
- * `link_to_remove_association` has been renamed `cocooned_remove_item_link`
47
- * Generated remove links class `remove_fields` has been renamed `cocooned-remove`
48
- * `cocoon:*` and `*.cocoon` Javascript events have been renamed to `cocooned:*` and `*.cocooned`
49
- (ex: `cocooned:before-insert`, `click.cocooned`)
50
- * The `cocoon` i18n scope have been renamed to `cocooned`
51
- * The `.nested-fields` default item wrapper class have been renamed to `cocooned-item`
52
-
53
- Other deprecations:
54
-
55
- * `link_to_add_association`/`cocooned_add_item_link` no longer require a `:render_options` hash to pass locals to the nested partial
56
-
57
- ### Non-breaking changes
58
-
59
- * Refactor cocoon javascript as a self-contained object with same functionalities
60
- * Automatically remove `required` attributes on destroyed elements (thanks @markkhair)
61
- * Add extra properties on events (thanks @ayaman)
62
- * Add a basic package.json to be used with Webpack (thanks @dmfrancisco)
63
- * Compatibility with jQuery 3 (thanks @mstmfm)
64
- * Namespace click handlers (thanks @chrise86)
65
- * Drop support for Ruby 1.9 (thanks @simi)
66
- * Remove Jeweller (thanks @brixen, @tlynam)
67
-
68
- ## Version 1.2.11
69
-
70
- * Allow events to be cancelled in the 'before' callbacks (thanks @wgordon17)
71
-
72
- ## Version 1.2.10
73
-
74
- * Use lazy-loading in initializer
75
-
76
- ## Version 1.2.9
77
-
78
- * Allow function pass to association-insertion-node (thanks @Liooo)
79
-
80
- ## Version 1.2.8
81
-
82
- * Compatibility with Turbolinks
83
-
84
- ## Version 1.2.7
85
-
86
- * Fix SimpleForm/Formtastic detections (thanks @mfrederickson)
87
- * Add default captions for add and remove links through I18n (thanks @ViliusLuneckas)
88
-
89
- ## Version 1.2.6
90
-
91
- * added some explicit documentation we use haml. Fixed the formtastic example.
92
- * "unfreeze" frozen objects. Fixes #193.
93
- * IE8 jquery fix (thanks @niuage).
94
- * merged #191 which fixes an issue with a monkeypatched CGI. For more info, see
95
- ticket #191. Thanks gsmendoza.
96
-
97
- ## Version 1.2.5
98
-
99
- * fix gem dependencies: we added gems to allow building for rubinius, but those are only
100
- needed when developing
101
-
102
- ## Version 1.2.4
103
-
104
- * the wrapper class is now configurable. Before it was assumed to be `nested-fields`.
105
- Now it is configurable by handing. See #180. Thanks Yoav Matchulsky.
106
- * fix build on travis-ci for rubinius (thanks brixen).
107
-
108
- ## Version 1.2.3
109
-
110
- * add license info
111
-
112
- ## Version 1.2.2
113
-
114
- * added option to add multiple items on one click. See #175.
115
- * cleaned up javascript code. See #171.
116
-
117
-
118
- ## Version 1.2.1
119
-
120
- * added a `:form_name` parameter (fixes #153) which allows to use a self-chosen
121
- parameter in the nested views. Up until now `f` was assumed (and enforced).
122
- * improvement of creation of the objects on the association (thanks to Dirk von Grünigen). This
123
- alleviates the need for the `:force_non_association_create` option in most cases.
124
- That option is for now still kept.
125
- * after validation errors, already deleted (but not saved) nested elements, will remain deleted
126
- (e.g. the state is remembered, and they remain hidden, and will be correctly deleted on next
127
- succesfull save) (fixes #136).
128
-
129
- ## Version 1.2.0
130
-
131
- * support for rails 4.0
132
-
133
- ## Version 1.1.2
134
-
135
- * pull #118 (thanks @ahmozkya): remove the deprecated `.live` function, and use `.on` instead.
136
- Note: at least jquery 1.7 is required now!
137
-
138
- ## Version 1.1.1
139
-
140
- * added the to be added/deleted element to the event, this allows to add animations/actions onto them
141
- * added extra option :wrap_object, allowing to use Decorators instead of the association object
142
- * added an option :force_non_association_create, that will allow to use `link_to_add_association` inside the fields-partial
143
-
144
- ## Version 1.1.0
145
-
146
- * BREAKING: the triggered javascript events `removal-callback`, `after-removal-callback`, and `insertion-callback` are renamed to the more correct and symmetric
147
- `cocoon:after-insert, cocoon:before-insert, cocoon:after-remove, cocoon:before-remove`. Also the events are namespaced to prevent collisions with other libraries.
148
- * allow created objects to be decorated with a callable. This is especially useful if you are using Draper or some decorator instead of the plain model in your views.
149
- * it is now possible to specify a relative node, and use standard jquery traversal methods on insertion
150
- * trigger insertion event on correct `insertionNode`
151
- * thanks to #90 cocoon now supports non-AR associations and array-fields, you just have to supply your own `build_<association>` methods
152
-
153
- I would really really like to thank all contributors, check them out https://github.com/nathanvda/cocoon/graphs/contributors
154
- They made cocoon way more awesome than I could have done in my lonesome.
155
-
156
- ## Version 1.0.22
157
-
158
- * Fix that it still works for mongoid
159
-
160
- ## Version 1.0.21
161
-
162
- * Use association build methods instead of assoc.klass.new. This avoids mass-assignment errors and other misbehaviors around attribute accessibility.
163
-
164
-
165
- ## Version 1.0.20
166
-
167
- * improved handing of the `:partial`: remove the extra options-hash, and just make it use the single hash, so now we can just write
168
-
169
- = link_to_add_association 'add something', f, :tasks, :partial => 'shared/task_fields'
170
- = link_to_add_association 'add something', f, :tasks, :class => 'your-special-class', :partial => 'shared/task_fields'
171
-
172
-
173
- ## Version 1.0.19
174
-
175
- * pull #53 (@CuriousCurmudgeon): fixed some bugs introduced in previous version (ooooops! Thanks!!!)
176
-
177
- ## Version 1.0.18
178
-
179
- * pull in #51 (@erwin): adding an `after-removal-callback` in javascript, very useful if you want to recalculate e.g. total-items or indexes
180
- * pull in #42 (@zacstewart): allow to hand extra `:locals` to the partial
181
- * updated documentation
182
-
183
- ## Version 1.0.17
184
-
185
- * fix: make sure that cocoon still works for rails 3.0, where the `conditions` is not available yet
186
-
187
- ## Version 1.0.16
188
-
189
- * merged pull request #33 (@fl00r): added the a custom partial option! genius :)
190
- Also the creation of the nested objects takes any available conditions into account.
191
- Now you can write
192
-
193
- = link_to_add_association 'add something', f, :tasks, {}, :partial => 'shared/task_fields'
194
-
195
- ## Version 1.0.15
196
-
197
- * added `data-association-insertion-method` that gives more control over where to insert the new nested fields.
198
- It takes a jquery method as parameter that inserts the new data. `before`, `after`, `append`, `prepend`, etc. Default: `before`.
199
- * `data-association-insertion-position` is still available and acts as an alias. Probably this will be deprecated in the future.
200
-
201
-
202
- ## Version 1.0.14
203
-
204
- * When playing with `simple_form` and `twitter-bootstrap`, I noticed it is crucial that I call the correct nested-fields function.
205
- That is: `fields_for` for standard forms, `semantic_fields_for` in formtastic and `simple_fields_for` for simple_form.
206
- Secondly, this was not enough, I needed to be able to hand down options to that method. So in the `link_to_add_association` method you
207
- can now an extra option `:render_options` and that hash will be handed to the association-builder.
208
-
209
- This allows the nested fields to be built correctly with `simple_form` for `twitter-bootstrap`.
210
-
211
- ## Version 1.0.13
212
-
213
- * A while ago we added the option to add a javascript callback on inserting a new associated object, I now made sure we can add a callback on insertion
214
- and on removal of a new item. One example where this was useful for me is visible in the demo project `cocoon_simple_form_demo` where I implemented a
215
- `belongs_to` relation, and either select from a list, or add a new element.
216
- So: the callback-mechanism has changed, and now the callback is bound to the parent container, instead of the link itself. This is because we can also
217
- bind the removal callback there (as the removal link is inserted in the html dynamically).
218
-
219
- For more info, see the `README`.
220
-
221
- ## Version 1.0.12
222
-
223
- * using "this" in `association-insertion-node` is now possible
224
-
225
- If you are using rails < 3.1, you should run
226
-
227
- rails g cocoon:install
228
-
229
- to install the new `cocoon.js` to your `public/javascripts` folder.
230
-
231
-
232
- ## Version 1.0.11
233
-
234
-
235
- ## Version 1.0.10
236
-
237
- * Fuck! Built the gem with 1.9.2 again. Built the gem again with 1.8.7.
238
-
239
- ## Version 1.0.9
240
-
241
- * is now rails 3.1 compatible. If you are not using Rails 3.1 yet, this should have no effect.
242
- For rails 3.1 the cocoon.js no longer needs to be installed using the `rails g cocoon:install`. It is
243
- automatically used from the gem.
244
-
245
- ## Version 1.0.8
246
-
247
- * Loosened the gem dependencies.
248
-
249
- ## Version 1.0.7 (20/06/2011)
250
-
251
- Apparently, the gem 1.0.6 which was generated with ruby 1.9.2 gave the following error upon install:
252
-
253
- uninitialized constant Psych::Syck (NameError)
254
-
255
- This is related to this bug: http://rubyforge.org/tracker/?group_id=126&atid=575&func=detail&aid=29163
256
-
257
- This should be fixed in the next release of rubygems, the fix should be to build the gem with ruby 1.8.7.
258
- Let's hope this works.
259
-
260
- ## Version 1.0.6 (19/06/2011)
261
-
262
- * The javascript has been improved to consistently use `e.preventDefault` instead of returning false.
263
-
264
- Run
265
-
266
- rails g cocoon:install
267
-
268
- to copy the new `cocoon.js` to your `public/javascripts` folder.
269
-
270
-
271
- ## Version 1.0.5 (17/06/2011)
272
-
273
- * This release make sure that the `link_to_add_association` generates a correctly clickable
274
- link in the newer rails 3 versions as well. In rails 3.0.8. the html was double escaped.
275
-
276
- If you are upgrading from 1.0.4, you just have to update the gem. No other actions needed. If you are updating
277
- from earlier versions, it is safer to do
278
-
279
- rails g cocoon:install
280
-
281
- This will copy the new `cocoon.js` files to your `public/javascripts` folder.
282
-
283
-