instance method set_disposition

Ruby on Rails 2.3.18

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

set_disposition( str, params = nil )

Allows you to set the content-disposition of the mail object. Accepts a type and a hash of parameters.

Example:

mail.set_disposition("attachment", {:filename => "test.rb"})
mail.disposition #=> "attachment"
mail['content-disposition'].to_s #=> "attachment; filename=test.rb"

Parameters

str req
params opt = nil
Source
# File actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/interface.rb, line 973
    def set_disposition( str, params = nil )
      if h = @header['content-disposition']
        h.disposition = str
        h.params.clear
      else
        store('Content-Disposition', str)
        h = @header['content-disposition']
      end
      h.params.replace params if params
    end

Defined in actionmailer/lib/action_mailer/vendor/tmail-1.2.7/tmail/interface.rb line 973 · View on GitHub · Improve this page · Find usages on GitHub

Defined in TMail::Mail

Type at least 2 characters to search.

↑↓ navigate · open · esc close