Flowdock
method

find_preview

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: MailersController
find_preview() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/rails/mailers_controller.rb, line 54
    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
Register or log in to add new notes.