Has anybody ever seen a great concise summary of best practices for file naming for a Rails project.
- Ruby classes: Underscores, all lower case
- Coffeescript/Javascript: hyphens (why? https://github.com/thoughtbot/guides/tree/master/style )
- Sass: ? Maybe hyphens?
- Haml, ERB: Underscores
- Yaml files?
- Directories (underscores always?)
- What else?
The only thing consistent seems to be:
- No caps (except README.md ? )
- No spaces
greg
(Greg Lazarev)
2
Underscores in file/directory names is a convention that is adopted in the Ruby community.
In JavaScript/CoffeeScript community underscores are predominant in filenames.
AFAIK, Sass has adopted the underscore convention as well.
To summarize, in a Ruby/Rails project use underscores everywhere (JS/CS could be either underscored or hyphenated).
Thanks @greg. I noticed this line in the Thoughtbot style guide. That was what piqued my curiosity.
Use hyphen-separated filenames, such as coffee-script.coffee.