perform_action!

論文なんかよりコードが書きたい!と思ってたらこれができた。


追記2:
private! - kelkronsoの日記


追記:
とおもったらだめだった

こいつでしっかりキャッチされてた><

      def perform_action_with_rescue #:nodoc:
        perform_action_without_rescue
      rescue Exception => exception
        rescue_action_with_handler(exception) || rescue_action(exception)
      end
class ApplicationController < ActionController::Base
 
  def perform_action_with_tx
    puts "before tx"
    ActiveRecord::Base.transaction do
      perform_action_without_tx
    end
    puts "after tx"
  end
  alias_method_chain :perform_action, :tx
end

class Controller << App///

  before_filter do 
    puts "before filter"
  end
  
  after_filter do
    puts "afiter filter"
  end
  
  def index
    
    puts "index in action"
  end

end

れっつあくせす!

before tx
before filter
index in action
afiter filter
after tx

まぁ囲んだだけなんだけどね…