1
0
Fork 0
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:
yuuji.yaginuma 2015-09-23 10:09:47 +09:00
parent 686897225e
commit 43ee2d8ce5
2 changed files with 3 additions and 3 deletions

View file

@ -31,7 +31,7 @@ class Rails::MailersController < Rails::ApplicationController # :nodoc:
raise AbstractController::ActionNotFound, "Email part '#{part_type}' not found in #{@preview.name}##{@email_action}"
end
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]
end
else

View file

@ -95,8 +95,8 @@
<% if @email.multipart? %>
<dd>
<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::TEXT ? 'selected' : '' %> value="?part=text%2Fplain">View as plain-text email</option>
<option <%= request.format == Mime::Type[:HTML] ? 'selected' : '' %> value="?part=text%2Fhtml">View as HTML email</option>
<option <%= request.format == Mime::Type[:TEXT] ? 'selected' : '' %> value="?part=text%2Fplain">View as plain-text email</option>
</select>
</dd>
<% end %>