Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created January 28, 2011 15:19
Show Gist options
  • Save ahoward/800374 to your computer and use it in GitHub Desktop.
Save ahoward/800374 to your computer and use it in GitHub Desktop.
# instead of setting all paths individually, you set all of them relative to
# another root, say my_gem/lib/rails/engine this way
if defined?(Rails)
module MyGem
class Engine < Rails::Engine
paths.path = MyGem.engine_dir
p paths.app.to_a #=> MyGem.engine_dir + '/app'
p paths.app.controllers.to_a #=> MyGem.engine_dir + '/app/controllers'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment