# Complex Forms

**URL:** <https://www.ruby-forum.com/t/complex-forms/134972>\
**Category:** Rails\
**Created:** [April 16, 2008, 6:24pm UTC](https://www.ruby-forum.com/t/complex-forms/134972 "2008-04-16T18:24:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 6:24pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/1 "2008-04-16T18:24:16Z")

</div>

Im trying to follow the railscasts complex forms tutorial, but im  
doing it with :through realted tables and im having some problems.

Ive made a pastie of the error and related files so its easier to  
read: [Parked at Loopia](http://pastie.caboo.se/181691)

Any thoughts? Thanks.

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 7:35pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/2 "2008-04-16T19:35:12Z")

</div>

Steven Harrison wrote:

> Im trying to follow the railscasts complex forms tutorial, but im  
> doing it with :through realted tables and im having some problems.
> 
> Ive made a pastie of the error and related files so its easier to  
> read: [Parked at Loopia](http://pastie.caboo.se/181691)
> 
> Any thoughts? Thanks.

run ruby -c file\_name  
on each file to make sure they pass [I guess they do]  
do a require\_dependency in one of the other?

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/3 "2008-04-16T20:36:48Z")

</div>

> do a require\_dependency in one of the other?  
> Thanks for your reply, but could you explain abit more please? Thanks.

On Apr 16, 6:35 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 9:28pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/4 "2008-04-16T21:28:10Z")

</div>

Thanks again Roger.

Yea you were right, the problem was with the name of the join table  
and model. I thought that was the naming convention, but thats  
apparently for has\_and\_belongs\_to\_many, and its better to have a  
meaningful singular name for the join table using :through.

Thanks again 😉

On Apr 16, 7:39 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 8:39pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/5 "2008-04-16T20:39:34Z")

</div>

Steven Harrison wrote:

> > do a require\_dependency in one of the other?  
> > Thanks for your reply, but could you explain abit more please? Thanks.
> 
> On Apr 16, 6:35 pm, Roger P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> ruby -c is  
> ruby -c app/models/orders\_…

# should say ok

doing require\_dependency  
would be  
at the top of one file,w here it errs, add  
require\_dependency ‘app/models/orders\_sandwiches’

I wonder if  
class OrdersSandwiches \< ActiveRecord::Base  
should be OrdersSandwich  
though 😛

---

<div class="post-metadata">

**Author:** ![rooster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/71c47a/32.png) [@rooster](https://www.ruby-forum.com/u/rooster)\
**Post date:** [April 16, 2008, 9:31pm UTC](https://www.ruby-forum.com/t/complex-forms/134972/6 "2008-04-16T21:31:12Z")

</div>

> Yea you were right, the problem was with the name of the join table  
> and model. I thought that was the naming convention, but thats  
> apparently for has\_and\_belongs\_to\_many, and its better to have a  
> meaningful singular name for the join table using :through.

I agree–their naming syntax is somehow lacking, in this instance 🙂
