Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"wrong constant name" error when generating a new model

I'm trying to create a new model like this:

rails generate model Tags name:string

When I run this, I get the following error:

base.rb:266:in `const_defined?': wrong constant name tags (NameError)

Any thoughts? I tried changing Tags to ReportTags and it still gave me the same error.

like image 866
blockcipher Avatar asked Feb 01 '11 18:02

blockcipher


1 Answers

Model names are singular - try

rails generate model Tag name:string
like image 131
miah Avatar answered Nov 06 '22 04:11

miah