[Ruby on Rails] Controller Creation and Naming Conventions

Tadashi Shigeoka ·  Sun, November 6, 2011

I researched the naming conventions when creating controllers with the rails generate command in Ruby on Rails, so here’s a memo.

Controller names can be specified in either “CamelCased” or “under_scored” format.

■ CamelCased example

$ rails generate controller FacebookUsers

■ under_scored example

$ rails generate controller facebook_users

In conclusion, regardless of which format you use, the created file names will be in “under_scored” format, and the created class names will be in “CamelCased” format.

【References】

コントローラの作成と命名規則 - コントローラ - Ruby on Rails入門

That’s all from the Gemba.