small medium large xlarge

Generic-user-small
16 Mar 2012, 19:49
Mark Lutze (1 post)

So just getting into the book (but very nice job - BTW) and perhaps this discussed later on, anyway in chapter 4 the command:

rails generate controller Say hello goodbye

Is the capitalization of Say significant? Then the use in the URL is “http://localhost:3000/say/hello” lower case. I am running in windows so does the URL behavior inherit the windows file system behavior?

Samr_small_pragsmall
16 Mar 2012, 22:27
Sam Ruby (634 posts)

Kinda. Sorta. Not really. And the answer doesn’t have to do with Windows.

Rails has all sorts of conventions, ranging from the names of Controllers, to the names of Models, to the names of Tables, to the names of routes to the names of source files, to… well, you get the idea.

The case of these names are generally significant. On Windows and on some file systems, you might get away with renaming some of the files, and you can adjust the URL by editing the config/routes.rb file, but I wouldn’t recommend it.

The “not really” aspect to all of this is that the generate command itself is pretty forgiving, and will coerce the input to match the Rails conventions.

You must be logged in to comment