Thanks for response.
I told about this:
http://github.com/giraffesoft/attribute_fu/tree/master/lib/attribute_fu/associated_form_helper.rb
def fields_for_associated(associated, *args, &block)
conf = args.last.is_a?(Hash) ? args.last : {}
associated_name = extract_option_or_class_name(conf, :name,
associated)
name = associated_base_name associated_name
unless associated.new_record?
name << "[#{associated.new_record? ? 'new' : associated.id}]"
else
@new_objects ||= {}
@new_objects[associated_name] ||= -1 # we want naming to start
at 0
identifier = !conf.nil? && conf[:javascript] ? '#{number}' :
@new_objects[associated_name]+=1
name << "[new][#{identifier}]"
end
@template.fields_for(name, *args.unshift(associated), &block)
end
HI dinamicly compose object name [new][#{identifier}] OR #{number}(for
JS) OR @new_objects[associated_name]+=1 for(new records but not JS)
I dont see fiture like this in
http://github.com/alloy/rails/tree/97f8b4fe8f1d8c53203023b19718ffa442622877/actionpack/lib/action_view/helpers/form_helper.rb
On 28 окт, 06:42, Eloy Duran <[EMAIL PROTECTED]> wrote:
> Hi Faust,
>
> First of all, sorry for the late response.
>
> > Thanks for useful plugin.
> > I whan ask, Why new version distribute not by plugin?
>
> About the plugin, it actually was a plugin that we used internally at
> Fingertips.
> Then this thread came up on the
> list:http://groups.google.com/group/rubyonrails-core/browse_thread/thread/...
> And after some discussion I decided to make a patch out of it,
> with some of the adjustments as suggested in that thread.
>
> > How i can implement it in my project
>
> If you want to use it right now, you could apply the patch
> to a vendor'ed rails checkout. _If_ I find some spare time
> I might backport the adjustments to the plugin and release that for
> the time being,
> but there are some patches to the AR::Associations internals etc,
> so it I have no idea right now how fast/when this would be done...
>
> > And another moment, when new records add dinamyc by JS new_id not
> > changed! I see this fiture in attribute_fu plugin
> >http://github.com/giraffesoft/attribute_fu/tree/master
> > Why you dont use this fiture?
>
> Could you maybe link to the actual code you are referring too?
>
> If you are talking about generating new record form entries from JS,
> then please also check the above mentioned thread, as I have done
> something like that. But basically it's fairly simple, so I don't really
> see the need for any helpers there.
>
> Cheers,
> Eloy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---