提交 b937ea89 编写于 作者: A Abdelkader Boudih

Make ActionMailer::Previews methods class methods.

上级 b6496713
* Make ActionMailer::Previews methods class methods. Previously they were
instance methods and ActionMailer tries to render a message when they
are called.
*Cristian Bica*
* Deprecate `*_path` helpers in email views. When used they generate
non-working links and are not the intention of most developers. Instead
we recommend to use `*_url` helper.
......
......@@ -22,7 +22,9 @@ module Previews #:nodoc:
# :nodoc:
mattr_accessor :preview_interceptors, instance_writer: false
self.preview_interceptors = []
end
module ClassMethods
# Register one or more Interceptors which will be called before mail is previewed.
def register_preview_interceptors(*interceptors)
interceptors.flatten.compact.each { |interceptor| register_preview_interceptor(interceptor) }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册