Sha256: 54cb0d5b47e134cd84e6ed5c87cc2d6e1623870fb00f9a4444ff64c262e25db7

Contents?: true

Size: 1.03 KB

Versions: 23

Compression:

Stored size: 1.03 KB

Contents

RailsEmailPreview::Engine.routes.draw do
  controller :emails do
    scope path: '(:email_locale)',
          # This constraint resolves ambiguity with :preview_id, allowing locale to be optional
          constraints: {email_locale: /#{I18n.available_locales.map(&Regexp.method(:escape)) * '|'}/},
          defaults: {email_locale: I18n.default_locale.to_s} do
      get '/' => :index, as: :rep_emails
      scope path: ':preview_id', constraints: {preview_id: /\w+-\w+/} do
        scope '(:part_type)',
              constraints: {part_type: /html|plain|raw/},
              defaults: {part_type: 'html'} do
          get '' => :show, as: :rep_email
          get 'body' => :show_body, as: :rep_raw_email
        end
        post 'deliver' => :test_deliver, as: :rep_test_deliver
        get 'attachments/:filename' => :show_attachment, as: :rep_raw_email_attachment
        get 'headers' => :show_headers, as: :rep_email_headers
      end
      # alias rep_emails_url to its stable api name
      get '/' => :index, as: :rep_root
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rails_email_preview-2.2.3 config/routes.rb
rails_email_preview-2.2.2 config/routes.rb
rails_email_preview-2.2.1 config/routes.rb
rails_email_preview-2.2.0 config/routes.rb
rails_email_preview-2.1.0 config/routes.rb
rails_email_preview-2.0.6 config/routes.rb
rails_email_preview-2.0.4 config/routes.rb
rails_email_preview-2.0.3 config/routes.rb
rails_email_preview-2.0.2 config/routes.rb
rails_email_preview-2.0.1 config/routes.rb
rails_email_preview-1.0.3 config/routes.rb
rails_email_preview-1.0.2 config/routes.rb
rails_email_preview-1.0.1 config/routes.rb
rails_email_preview-1.0.0 config/routes.rb
rails_email_preview-0.2.31 config/routes.rb
rails_email_preview-0.2.30 config/routes.rb
rails_email_preview-0.2.29 config/routes.rb
rails_email_preview-0.2.28 config/routes.rb
rails_email_preview-0.2.27 config/routes.rb
rails_email_preview-0.2.26 config/routes.rb