Commit Graph

31 Commits

Author SHA1 Message Date
Dmytrii Nagirniak
bee1a8ba0b Allow to build plural transient associations 2012-09-24 18:20:18 +10:00
Dmytrii Nagirniak
80f949d15a Allow to create association from build_xyz method on an object 2012-09-24 18:15:25 +10:00
Dmytrii Nagirniak
3f59065366 Refactor object creating and add pending spec 2012-09-24 18:08:07 +10:00
Dmytrii Nagirniak
a581d0a3ec Raise more describprive error when can't reflect on association 2012-09-24 17:47:47 +10:00
Sebastian Edwards
c33df6fec5 Allow created objects to be decorated via a callable option. 2012-09-19 22:37:35 +12:00
Gauthier Delacroix
9e3f0436d1 Rename JS 'template' data 2012-08-29 10:33:40 +02:00
nathanvda
37ab5dd2c5 Make sure it still works if we are working with mongo (use the old code then). We use the class-name so we do not get any issues when Mongoid is not known. Fixes #65. 2012-05-21 00:55:33 +02:00
Jeffrey Chupp
5ddefa399d Use association build methods instead of assoc.klass.new. This avoids mass-assignment errors and other misbehaviors around attribute accessibility. 2012-05-04 19:55:12 -04:00
nathanvda
0225126532 Remove the extra options-hash for the partial, instead use the same html_options hash. Is less confusing, and matches the documentation (I was under the impression it was already like that --ooops). 2012-04-09 12:45:59 +02:00
Brian Meeker
e43a03919c Make sure that locals is always initialized in render_association. If it is not, the call to Hash#merge will fail. 2012-04-07 16:59:43 -04:00
Brian Meeker
5fa318a7f6 Pass options through to link_to_add_association when calling with block for link text. 2012-04-07 11:34:57 -04:00
nathanvda
ae21d63679 Pulled in changes from zacstewart (pull #42), but with extra documentation and test. 2012-04-07 02:14:26 +02:00
nathanvda
7212a7a13c Update the documentation, to match the availability of some extra options :partial and :render_options. 2012-04-07 01:15:27 +02:00
nathanvda
7bcd2aa98d Make sure cocoon still works on rails 3.0 (where conditions is not yet supported). Fixes #47. 2012-03-16 20:08:19 +01:00
fl00r
3f5e89361f Added custom partial feature 2012-03-12 23:30:11 +04:00
fl00r
04c231570b Few minor fixes:
- Gemfile.lock is kicked out
- rdoc/task fix

Added support of  in associations
2012-03-12 23:07:10 +04:00
nathanvda
003040bc0b Added an extra option :render_option which is handed to the nested fields for builder. Also call the correct nested fields builder for each form builder (e.g. semantic_fields_for, simple_fields_for or fields_for). 2011-10-22 01:42:07 +02:00
nathanvda
e410388bd6 Added tests for the install generator. 2011-07-24 00:54:15 +02:00
nathanvda
1628bb19d3 Made Cocoon Rails 3.1 compatible:
- moved cocoon.js to app/assets/javascripts
- adapted install-generator accordingly (for rails 3.0.x)
- made it an engine instead of railtie (to use the asset pipeline)
2011-07-24 00:17:40 +02:00
gray
407fad5410 Add if/else brackets 2011-07-19 15:49:59 +03:00
gray
01ec1ff00b Small refactor cocoon.js 2011-07-19 12:53:04 +03:00
nathanvda
2890be2f53 Fixes #9. Make sure that the link_to_add_association also works in rails 3.0.8. by making sure the template-html is not double escaped. 2011-06-18 01:32:38 +02:00
Tangerine Cat
cebcb21242 Made available call to external jQuery callbacks on add_fields click 2011-04-25 00:48:26 +02:00
nathanvda
630a88a704 Avoid HTML collisions. Inspired by the code from rfc2616. This fixes #6. 2011-04-25 00:21:13 +02:00
nathanvda
bf34b7494b Added the code from rfc2616: push in plurals from ruby, with added (simple) tests 2011-04-24 14:36:50 +02:00
Andrius Chamentauskas
657e478801 Template is now saved under data-association attribute to prevent those extra blank records when submitting form. 2011-03-15 16:41:17 +02:00
David Roetzel
7e8de74176 Use hidden_field_tag instead of hidden_field.
This works around problems with
accepts_nested_attributes_for :reject_if => :all_blank.
hidden_field injects a (String!) value of "false"
into the form, effectively disabling the all_blank
check.
2011-03-04 16:36:12 +01:00
nathanvda
95f7d5237f If a block is given, no link-text needs to be given as a parameter anymore. 2011-03-03 21:15:12 +01:00
Mihai Târnovan
75c3a9bacd * added option to specify position of insertion for the add partial 2011-03-03 19:22:23 +01:00
Mihai Târnovan
dc1ad12845 * added html_options and block args to link_to_remove association and link_to_add_association 2011-03-03 18:54:43 +01:00
nathanvda
dc09be5634 moved from formtastic-cocoon to just cocoon 2011-02-09 22:03:53 +01:00