Thursday, April 28, 2011

Rails: Page Names With Numbers

I was working on a Rails application today and kept getting errors like this:

app/controllers/home_controller.rb:7: syntax error, unexpected tINTEGER
def 30onepager

Integer?! What integer?

Turns out you really shouldn't start method names with numbers. I made the method:

def onepager30

and everything came out just fine.

Not a hard error to figure out, but a gotcha.

No comments:

Post a Comment