Rails naming gotcha

A quick one in hope that it might save some people a minor headache… I just found out that you can’t use the word URL as a Model name in Rails, otherwise you’ll get a

undefined method `rewrite' for #<Url:0xb7675e64>

error.

Digg some Convention over Configuration

2 Responses to “Rails naming gotcha”

  1. Josh G Says:

    Apparently you can’t use “Class” as a class in Java either. Sheesh, now how am I gonna model my university app?? Lame lexers.

    Recommend something like “address” as attribute name rather than “URL” anyway (plus they’ll be IRIs anytime soon).

  2. George Malamidis Says:

    Yep, same as ‘private’, ‘public’, etc. With the slight difference that these are keywords at the language as oposed to framework level.