Hi everybody !
I’m trying to extend the class ApplicationController with a plugin to
add filters to follow some executions. I don’t know why, but I observed
a weird behaviour and I don’t know why. Here is my code.
init.rb
require ‘myplugin’
myplugin.rb
ApplicationController.class_eval do
before_filter do
puts “I’m in the before_filter”
end
end
The things is this filter happens just the first time (the first action
after Webrick is loaded). Well, I tried to do the same thing, extending
ActionController::Base, and it works without problems. But I’d like to
extend ApplicationController and not the Base.
Any ideas ?