Categories
learning meaningful labor rails

Ruby Uninitialized Constant Error (Mental Note)

The reason I always get initialized constant errors occurring in Ruby is accidentally naming models the plural form of the database table name and not letting Rails automatically create the pluralisations.

script/generate scaffold contact_skill contact_id:integer skill_id:integer description:string
not
script/generate scaffold contact_skills ...

(This reason is one I constantly forget, and Google never helps me. Now I will not forget)

—–

edit: I’ve had a LOAD of google hits from this search query in the last few days, if this helps you or doesn’t please leave a comment to make this article more complete.