Forum: Ruby on Rails application naming convention

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.
Brian M. (Guest)
on 2007-07-18 20:46
I'm creating a new rails app.  The application is named BigIdea.  Should
I create this project using:

1.  rails bigidea

or

2.  rails big_idea



I know both will work, but just want to get off to the right start using
the proper rails naming convention.

Thanks!
Brian
Dave S. (Guest)
on 2007-07-18 22:04
I would say that you should use whatever you want to see in a URL.

1) www.somewebsite.com/bigidea/

or

2) www.somewebsite.com/big_idea/

Of course, you can rewrite URLs anyway, so it ultimately doesn't matter
at all.
Brian M. (Guest)
on 2007-07-18 22:30
Thanks Dave.

I'm not sure I follow this response.  "BigIdea" is the name of the
application, not a controller.  Therefore, the url would always be:

www.bigidea.com

But, of course, the name of the rails application (basically the root
rails folder) isn't tied directly to the site url.

Let me put this another way.  Should my directory structure look like:

bigidea
bigidea/app
bigidea/components
bigidea/config
bigidea/db
...

or

big_idea
big_idea/app
big_idea/components
big_idea/config
big_idea/db
...


Again, I realize the short answer probably is "it doesn't matter", in
which case I'm inclided to use the shorter version "bigidea".  But want
to make sure I'm not missing something here regarding naming convention.
For example, I know that by convention, this dictates the name of my
database.  Should I care whether my development db is named
"bigidea_development" or "big_idea_development"?

Thanks again.

Dave S. wrote:
> I would say that you should use whatever you want to see in a URL.
>
> 1) www.somewebsite.com/bigidea/
>
> or
>
> 2) www.somewebsite.com/big_idea/
>
> Of course, you can rewrite URLs anyway, so it ultimately doesn't matter
> at all.
Jon G. (Guest)
on 2007-07-19 03:00
(Received via mailing list)
definitely big_idea
Anywhere you use CamelCase for something and need to convert it to lower
case, it's good habit to use underscores to separate the words.  Theres
even a couple fancy methods on string help.

"CamelCase".underscore   => "camel_case"
"camel_case".camelize => "CamelCase"

--
http://www.5valleys.com/
This topic is locked and can not be replied to.