Skip to content

Instantly share code, notes, and snippets.

@juniorz
Created January 17, 2012 12:14
Show Gist options
  • Save juniorz/1626461 to your computer and use it in GitHub Desktop.
Save juniorz/1626461 to your computer and use it in GitHub Desktop.
Principais hooks do Rails
module MyAwesomeEngine
class Engine < Rails::Engine
#isolate_namespace MyAwesomeEngine
config.after_initialize do
puts "Terminou a inicializacao"
end
# Antes de cada requisição (1 vez em production e sempre em development)
config.to_prepare do
puts "To Prepare
end
ActionDispatch::Callbacks.before do
puts "Vai processar a requisicao"
end
ActionDispatch::Callbacks.after do
puts "Acabou a requisicaoo"
end
initializer 'myawesomeengine.initialize_nothing' do
puts "Engine initializer"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment