Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RubyOnRails: Problem representing objects in forms

0 views
Skip to first unread message

rexlo...@gmail.com

unread,
Nov 6, 2005, 7:13:15 PM11/6/05
to
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...

Eric Hodel

unread,
Nov 7, 2005, 2:34:29 PM11/7/05
to

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

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

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

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


rexlo...@gmail.com

unread,
Nov 8, 2005, 9:06:50 PM11/8/05
to
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"?

Martin DeMello

unread,
Nov 9, 2005, 11:18:58 AM11/9/05
to
rexlo...@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

Austin Ziegler

unread,
Nov 9, 2005, 11:29:15 AM11/9/05
to
On 11/8/05, rexlo...@gmail.com <rexlo...@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).

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
--
Austin Ziegler * halos...@gmail.com
* Alternate: aus...@halostatue.ca


0 new messages