I decided to create a new complemental library called ripple-anaf 
(http://github.com/bkaney/ripple-anaf) ready for public review.  I pushed a 
pre-release to gemcutter.

The library now supports :reject_if and :allow_destroy (which is all I need 
right now for my application, but I might toss in :limit and :update_only 
later).  See 
http://api.rubyonrails.org/classes/ActiveRecord/NestedAttributes/ClassMethods.html#method-i-accepts_nested_attributes_for
 for AR documentation and context.


I saw how the embedded associations work and built the DSL to use the same ANAF 
for both linked and embedded (so I can use the same `fields_for` pattern in my 
views, regardless of the type of association).  However, I do have a logic 
question for `many` embedded documents.  I didn't see a  key for embedded docs, 
so how would I specify which one for deletion / update / etc.?  Or am I missing 
the concept of many embedded docs?


--
Brian



On Sep 1, 2010, at 10:00 PM, Brian Kaney wrote:

> Yea, I was working on linked associations, I haven't explored how embedded 
> associations ANAF yet.
> 
> 
> On Sep 1, 2010, at 9:39 PM, Adam Hunter wrote:
> 
>> Hey,
>> 
>> I assume this works for linked associations?  (Embedded ones automatically 
>> accept nested attributes). Looking forward to seeing :reject_if for both 
>> linked and embedded.
>> 
>> Thanks!
>> 
>> Adam
>> 
>> On Sep 1, 2010, at 9:32 PM, Brian Kaney wrote:
>> 
>>> Hey Everyone,
>>> 
>>> I am very excited about the new `one` and `many` relationships, and put 
>>> together a first pass of an implementation of 
>>> accepts_nested_attributes_for[1] (see the rdoc[2]).
>>> 
>>> [1]:http://github.com/bkaney/ripple/commits/anaf
>>> [2]:http://github.com/bkaney/ripple/blob/anaf/ripple/lib/ripple/nested_attributes.rb
>>> 
>>> I want to use `fields_for` and the rails machinery for ANAF, as I feel is 
>>> it a very critical and reusable tool for app development.  
>>> 
>>> I haven't implemented :reject_if or :allow_delete options, but plan to in 
>>> the near future.  I was hoping to get some eyes and critiques on this very 
>>> early first pass.
>>> 
>>> 
>>> --
>>> Brian
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> riak-users mailing list
>>> [email protected]
>>> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>> 
> 
> 
> _______________________________________________
> riak-users mailing list
> [email protected]
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com


_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to