Skip to content

Instantly share code, notes, and snippets.

@stubotnik
Created September 21, 2012 08:58
Show Gist options
  • Save stubotnik/3760461 to your computer and use it in GitHub Desktop.
Save stubotnik/3760461 to your computer and use it in GitHub Desktop.
uninitialized constant error
class MyProject < Padrino::Application
register Padrino::Rendering
register Padrino::Mailer
register Padrino::Helpers
MY_CONST = 123
end
MyProject.controller do
get "/" do
p self.class # => MyProject
p self.class.constants # => [:DATA_ATTRIBUTES, ... <snip>..., :MY_CONST, ... <snip>... ]
p MyProject::MY_CONST # => 123
p MY_CONST # => NameError - uninitialized constant MY_CONST
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment