Previewing Mailers on non-development tiers
问题 I have several mailer previews under spec/mailer/previews . On development I can view all the previews under /rails/mailers/ . However by default this functionality does not exist on other environments. I wanted to enable it on the staging environment and took a queue from this post here. I made the following changes - config/routes.rb # Add the routes manually if Rails.env.staging? get "/rails/mailers" => "rails/mailers#index" get "/rails/mailers/*path" => "rails/mailers#preview" end config