adding/removing nested forms and copy their data by textfield input

0 views
Skip to first unread message

patrick

unread,
Jun 17, 2008, 10:16:50 PM6/17/08
to attribute_fu
Hi everyone,

I just got attribute_fu working in my app (how awesome it is!), and
the way my app is setup, its like this:

Project has many Releases, and Releases has may discs.

So I have my new.html.erb file which then points to a
_releases.html.erb for attribute_fu, and inside the releases, it
points to _discs.html.erb.. As of right now, I have add/remove links
that when clicked add/remove a project's release's disc... It's funny
functional and I can't express how awesome it is!

However, what I ultimately would like is to have a textfield which
will dynamically add/remove addiitonal disc form-fields based off of
the number typed into the textfield... The other thing I want to do
is be able to have the value of each field inside the last disc's form
be automatically copied over to the newly created form...

So I am hoping that someone here can point me in the right direction
as far as how I might be able to do both of these things

Thank you very much.

-patrick

patrick

unread,
Jun 17, 2008, 10:22:00 PM6/17/08
to attribute_fu
Oops.. I forgot one other thing!

Inside my _discs.html.erb file, I have a fieldset and legend tags
which say Disc Information... I would like to have that display the
actual disc number in the order of disc forms that have been added by
attribute_fu... Any suggestions on how to do this would be greatly
appreciated.

-patrick

James Golick

unread,
Jun 19, 2008, 9:20:20 AM6/19/08
to attrib...@googlegroups.com
I don't think these things are going to be possible using a vanilla a_fu.

Your best bet is to read thru the js in the plugin, and see if you can find a way to hack support in.

J.
Reply all
Reply to author
Forward
0 new messages