Module: MailerLayouts::ClassMethods
- Defined in:
- lib/mailer_layouts.rb
Instance Method Summary collapse
-
#radiant_layout(name = nil, options = {}, &block) ⇒ Object
class method to set default radiant layout.
Instance Method Details
#radiant_layout(name = nil, options = {}, &block) ⇒ Object
class method to set default radiant layout
25 26 27 28 29 30 31 32 33 |
# File 'lib/mailer_layouts.rb', line 25 def radiant_layout(name=nil, ={}, &block) # class method to set default radiant layout raise ArgumentError, "A layout name or block is required!" unless name || block write_inheritable_attribute :default_layout, name || block # radiant_mailer is an actual layout file in app/layouts/radiant_mailer.html.haml # but all it does is call the mailer_layout method defined in MailerHelper # and pass to it the necessary instance variables. layout 'radiant_mailer', end |