« Obscure tags | Main | Eat your own dog-food »

December 31, 2006

'Templates' is a reserved word in Rails

Feck it!

I had started coding up my CMS (slick! wait til you see it!) and had chosen to use a table in the DB schema called, innocently enough I thought, 'Templates' which of course held all the templates that the system would be using to create nicely formatted XHTML from the data stored in the DB.

I kept getting a weird error whenever I tried to add a new Template:

undefined method `assign_variables_from_controller' for ...

Head.Scratch. WTF?

Poked about a bit in the API, restarted WebBrick a few times and then decided to hit Google.

Templates is a reserved word huh?

OK

I rolled back all the migrations (how great are they? Very. Very very. Very very very). I decided to rename the 'Templates' table to 'JellyMoulds'. Then I thought I should be less flippant with the application that was meant to be making me my living in the coming months.

Clickety clik - off to dictionary.com - and a quick check in the Thesaurus.

I settled on 'Stencils'

I still might go back to 'JellyMoulds'

;)

So don't forget - TEMPLATES is a RESERVED WORD IN RAILS

Posted by dottie at December 31, 2006 4:34 PM

Trackback Pings

TrackBack URL for this entry:
http://www.5thpercentile.com/blog/mt-tb.cgi/7

Comments

Post a comment




Remember Me?

(you may use HTML tags for style)