Skip to content

Instantly share code, notes, and snippets.

@jakeonrails
Created December 14, 2011 02:27
Show Gist options
  • Save jakeonrails/1474972 to your computer and use it in GitHub Desktop.
Save jakeonrails/1474972 to your computer and use it in GitHub Desktop.
Loading a class inside a module within Rails 3.0
# within app/importer/api.rb
module Importer
class API
# class body here
end
end
# this way works for some reason
# inside app/importer/api.rb
class Importer::API
# class body here
end
/Users/jake/Code/experimental/myproject/config/application.rb:10)
Loading development environment (Rails 3.0.10)
ruby-1.9.2-p290 :001 > Importer::API.new
LoadError: Expected /Users/jake/Code/experimental/myproject/app/importer/api.rb to define API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment