diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-30 13:19:22 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-30 13:19:22 +0000 |
commit | 4899ae188f728bfd77b6db950fd5a1e3180c7be8 (patch) | |
tree | 45523bfd14cd8479462cf790c987bf63d863edef /lib/controller_patches.rb | |
parent | 7a758a657e10c5b6a11355c9dad205178342096f (diff) |
Create stubs for the various points where a user might want to customise Alaveteli via their theme, as per suggestions by @dcabo on [the mailing list](http://groups.google.com/group/alaveteli-dev/msg/f50eba23f75b5c75)
Diffstat (limited to 'lib/controller_patches.rb')
-rw-r--r-- | lib/controller_patches.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/controller_patches.rb b/lib/controller_patches.rb new file mode 100644 index 0000000..11b5722 --- /dev/null +++ b/lib/controller_patches.rb @@ -0,0 +1,15 @@ +# Add a callback - to be executed before each request in development, +# and at startup in production - to patch existing app classes. +# Doing so in init/environment.rb wouldn't work in development, since +# classes are reloaded, but initialization is not run each time. +# See http://stackoverflow.com/questions/7072758/plugin-not-reloading-in-development-mode +# +require 'dispatcher' +Dispatcher.to_prepare do + # Example adding an instance variable to the frontpage controller + GeneralController.class_eval do + def mycontroller + @say_something = "Greetings friend" + end + end +end |