aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/mailers_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'railties/lib/rails/mailers_controller.rb')
-rw-r--r--railties/lib/rails/mailers_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/mailers_controller.rb b/railties/lib/rails/mailers_controller.rb
index 000ce40fbc..7ff55ef5bf 100644
--- a/railties/lib/rails/mailers_controller.rb
+++ b/railties/lib/rails/mailers_controller.rb
@@ -6,6 +6,8 @@ class Rails::MailersController < Rails::ApplicationController # :nodoc:
before_action :require_local!, unless: :show_previews?
before_action :find_preview, only: :preview
+ helper_method :part_query
+
def index
@previews = ActionMailer::Preview.all
@page_title = "Mailer Previews"
@@ -19,7 +21,7 @@ class Rails::MailersController < Rails::ApplicationController # :nodoc:
@email_action = File.basename(params[:path])
if @preview.email_exists?(@email_action)
- @email = @preview.call(@email_action)
+ @email = @preview.call(@email_action, params)
if params[:part]
part_type = Mime::Type.lookup(params[:part])
@@ -76,4 +78,8 @@ class Rails::MailersController < Rails::ApplicationController # :nodoc:
@email
end
end
+
+ def part_query(mime_type)
+ request.query_parameters.merge(part: mime_type).to_query
+ end
end