Created
January 17, 2012 12:14
-
-
Save juniorz/1626461 to your computer and use it in GitHub Desktop.
Principais hooks do Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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