mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
stop using deprecated method in mailers controller
Accessing mime types via constants is deprecated.
This commit is contained in:
parent
686897225e
commit
43ee2d8ce5
2 changed files with 3 additions and 3 deletions
|
@ -31,7 +31,7 @@ class Rails::MailersController < Rails::ApplicationController # :nodoc:
|
||||||
raise AbstractController::ActionNotFound, "Email part '#{part_type}' not found in #{@preview.name}##{@email_action}"
|
raise AbstractController::ActionNotFound, "Email part '#{part_type}' not found in #{@preview.name}##{@email_action}"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@part = find_preferred_part(request.format, Mime::HTML, Mime::TEXT)
|
@part = find_preferred_part(request.format, Mime::Type[:HTML], Mime::Type[:TEXT])
|
||||||
render action: 'email', layout: false, formats: %w[html]
|
render action: 'email', layout: false, formats: %w[html]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
|
@ -95,8 +95,8 @@
|
||||||
<% if @email.multipart? %>
|
<% if @email.multipart? %>
|
||||||
<dd>
|
<dd>
|
||||||
<select onchange="document.getElementsByName('messageBody')[0].src=this.options[this.selectedIndex].value;">
|
<select onchange="document.getElementsByName('messageBody')[0].src=this.options[this.selectedIndex].value;">
|
||||||
<option <%= request.format == Mime::HTML ? 'selected' : '' %> value="?part=text%2Fhtml">View as HTML email</option>
|
<option <%= request.format == Mime::Type[:HTML] ? 'selected' : '' %> value="?part=text%2Fhtml">View as HTML email</option>
|
||||||
<option <%= request.format == Mime::TEXT ? 'selected' : '' %> value="?part=text%2Fplain">View as plain-text email</option>
|
<option <%= request.format == Mime::Type[:TEXT] ? 'selected' : '' %> value="?part=text%2Fplain">View as plain-text email</option>
|
||||||
</select>
|
</select>
|
||||||
</dd>
|
</dd>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue