0
在Rails 3我想打電話給alias_method
從我before_filter
但我得到這個錯誤:NoMethodError in MyController#index
從ActionController的調用alias_method,NoMethodError
class ApplicationController < ActionController::Base
before_filter :my_test
protect_from_forgery
helper :all
def my_test
debugger
alias_method :new_method_name, :old_method_name
end
end
從調試器:
(rdb:3) p self.methods.grep /old_method_name/
["old_method_name"]
無論誰打開這個問題,請解釋你爲什麼這樣做。 – BeemerGuy 2010-10-22 23:04:20
您將不得不向我們提供更多信息,而不僅僅是一條錯誤消息。您使用的代碼將是一個很好的開始。 – 2010-10-22 23:04:29