I have a ruby view that has this namespace: ActionView::Base.new but i want to add a new method to be available to this ActionView::Base class
I have a ruby view that has this namespac开发者_如何学Goe: ActionView::Base.new but i want to add a new method to be available to this ActionView::Base class.
in myapp/lib/action_view_monkey_patch.rb do:
ActionView::Base.class_eval do
def method_name
#do some stuff
end
end
精彩评论