Uninitialized Constants in Scaffolds

I’ve just got the solution to a problem I’d been having.
It looks like it’s quite common, so here goes:

When creating a scaffold page (using script/generate scaffold
if you look at the pages it makes (through the server,
all pages work except LIST, which complains of
Uninitialized Constant [your model name]

This seems to be to do with Rails’ use of convention instead of

  • Database name should be lowercase. The first call to Rails
    my_app should be identical (same lower case).

  • Table names should be lower case and pluralised (ie topics, not topic
    or Topics)

  • Calls to script/generate scaffold should be lower case and
    SINGULAR (ie topic, not topics or Topic or Topics)

I think this should be made more clear to n00bs like myself. I’m finding
the online documentation for Rails is terrible. (Ruby has some great
docs though).

I hope that helps anyone who was getting as frustrated as I was

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs