Skip to content

Instantly share code, notes, and snippets.

@nicholasjhenry
Created November 9, 2012 21:33
Show Gist options
  • Select an option

  • Save nicholasjhenry/4048396 to your computer and use it in GitHub Desktop.

Select an option

Save nicholasjhenry/4048396 to your computer and use it in GitHub Desktop.
Rails Engine Tips
module Refinery
module CustomFeature
class Engine < Rails::Engine
initializer "core.load_app_instance_data" do |app|
app.class.configure do
# Add migrations to the host application's path
config.paths['db/migrate'] += Refinery::Templates::Engine.paths['db/migrate'].existent
end
end
config.to_prepare do
# Add a custom helper
Refinery::Admin::PagesController.helper(Refinery::Admin::CustomHelper)
end
end
end
end
@nicholasjhenry
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment