Forum: Ruby on Rails Underscore or not?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nic W. (Guest)
on 2005-12-29 03:25
(Received via mailing list)
The Agile book mentions that using an underscore to break up words is
the 'preferred' method, but later says that you'll have trouble using
them in many-to-many association tables. What are people doing? It
sounds like less of a hassle to cram my words together (cablepair vs
cable_pair) and enjoy the native many-to-many handling.

Or maybe I just answered my own question.
--
- Nic
Jake J. (Guest)
on 2005-12-29 03:29
Nic W. wrote:
> The Agile book mentions that using an underscore to break up words is
> the 'preferred' method, but later says that you'll have trouble using
> them in many-to-many association tables. What are people doing? It
> sounds like less of a hassle to cram my words together (cablepair vs
> cable_pair) and enjoy the native many-to-many handling.
>
> Or maybe I just answered my own question.
> --
> - Nic



I use underscores in most cases.  I've also found that the "Rails Way"
for doing table associations doesn't always work best for me, so I call
out those table names in many cases.

Basically, I do what I think is best for the situation.  If Rails
doesn't agree with me, I call out the name manually.

   Jake
This topic is locked and can not be replied to.