When modeling names. Should the containing folder name be in the plural?

when the space between names is modeled. should the containing folder name be in the plural?

i.e. models/users/comment.rbor models/user/comment.rb?

+3
source share
3 answers

It must exactly match the namespace, so creating an exclusive namespace means the only thing for the folder.

, , . , - , . Rails , . , , - REST. .

+1

, .

, .

rails g model User/Comment

,

User::Comment
+1

Just download this: Models with names

Rails::Initializer.run do |config|
  # Your existing stuff

  config.load_paths << "#{RAILS_ROOT}/app/models/pets"
end
0
source

All Articles