0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Rails 命名規則について

Posted at

Rails 命名規則について

コントローラを作成する(小文字で複数形)

controller.rb
$ rails g controller homes

コントローラ名 複数形、先頭は英小文字 homes
コントローラのクラス名 複数形、先頭は英大文字 HomesController
ファイル名 複数形、先頭は英小文字 homes_controller.rb

モデルを作成する(先頭大文字で単数形)

model.rb
 $ rails g model List

モデル名 単数形、先頭は英大文字 List
モデルのファイル名 単数形、先頭は英小文字 list.rb
テーブル名 複数形、先頭は英小文字 lists

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?