method
find_preview
v6.1.3.1 -
Show latest stable
- Class:
Rails::MailersController
find_preview()public
No documentation available.
# File railties/lib/rails/mailers_controller.rb, line 56
def find_preview # :doc:
candidates = []
params[:path].to_s.scan(%{/|$}) { candidates << $` }
preview = candidates.detect { |candidate| ActionMailer::Preview.exists?(candidate) }
if preview
@preview = ActionMailer::Preview.find(preview)
else
raise AbstractController::ActionNotFound, "Mailer preview '#{params[:path]}' not found"
end
end