RubyOnRails: Problem representing objects in forms

Hello,

I am having a huge problem representing objects in my forms with Rails'
FormHelper.

Object setup:

apt_transactions :has_many transaction_participants

Value setup:

apt_transactions has a value of monetary_total
transaction_participants has a value of monetary_share

Problem:

Now, I am trying to have a form in which a user can enter in data in
which they can set the monetary_total and specific how that total is
divided amoung the transaction_participants.

Now, my question is, how can this relationship be represented in a
form?

I am having trouble getting the FormHelper to work:

<%= text_field("apt_transaction_transaction_participants[]",
"monetary_share") %>
produces a NoMethodError exception

I have no clue how this will be represented in a form. For example,
would it appear as:

<input type="text"
name="apt_transactions[transaction_participants][][monetary_share]" >

I have no clue...

For the fastest and best answers, please consult the Ruby on Rails mailing list. They have armies of highly skilled Rails users ready to take your question and bring it to a stunning victory.

http://lists.rubyonrails.org/mailman/listinfo/rails

···

On Nov 6, 2005, at 4:17 PM, rexlorenzo@gmail.com wrote:

Hello,

I am having a huge problem representing objects in my forms with Rails'
FormHelper.

--
Eric Hodel - drbrain@segment7.net - http://segment7.net
FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04

Well, I did post on the mailing list and tried subscribing to it, but
it was way too much traffic (even with digest mode on).

Just to simply my question. Suppose an object "foo" has many "bar"
objects.

How would you represent the many "bar" objects, so that you can provide
a form to add/edit them along with the other attributes of "foo"?

rexlorenzo@gmail.com wrote:

Well, I did post on the mailing list and tried subscribing to it, but
it was way too much traffic (even with digest mode on).

I suggest setting digest mode back to off, and creating a gmail account
to subscribe to the list instead. It has a very nice interface and no
space limitation issues, so you can filter the list not to appear in
your inbox, and then just let the mail flood in and only read the ones
you're interested in.

martin

The problem is that this list is very active as well and many of the
people here are not Ruby on Rails users and cannot answer specific
questions about that software package. If a question is about Ruby in
general, then it's certainly appropriate for ruby-talk; if it's about
habtm or some other *specific* Rails question (or any other package,
really), the question *probably* belongs on the appropriate package
mailing list, if it exists.

-austin

···

On 11/8/05, rexlorenzo@gmail.com <rexlorenzo@gmail.com> wrote:

Well, I did post on the mailing list and tried subscribing to it, but
it was way too much traffic (even with digest mode on).

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca