In Ruby on Rails 3, I can't scaffold a model called Data
. I can make the Data
controlle开发者_如何学Cr but I can't make the Data
model. It has to be UserData
or something along those lines.
Ruby on Rails says, it is being used already (my guess is) by the gem itself.
Am I the only one getting this?
How come I cannot create the model name to be Data
only?
I think your problem is that there is already a Data class in the Ruby standard library (both 1.9+ and 1.8.7). The Data class is only defined in one of the C source files but it is still publicly visible. I'm not sure what the Data class is for (and the documentation is rather sparse) but the name is already in use so Rails won't let you use it. You can make the controller easily enough because the controller will be DataController and that name isn't taken.
精彩评论