class SampleFilter
def initialize(options)
end
def before(controller)
end
def after(controller)
controller.response.body.gsub!(/hoge/, 'fuga')
end
end
class ActionController::Base
def self.sample_before_filter(options = {})
before_filter SampleFilter.new(options)
end
def self.sample_after_filter(options = {})
after_filter SampleFilter.new(options)
end
def self.sample_around_filter(options = {})
around_filter SampleFilter.new(options)
end
end
class SampleController < ApplicationController
sample_after_filter :only => [:index]
end