Skip to content

Instantly share code, notes, and snippets.

@firewalker06
Forked from lengarvey/staging.rb
Last active August 29, 2015 14:15
Show Gist options
  • Save firewalker06/dc6976d2042b7b34a925 to your computer and use it in GitHub Desktop.
Save firewalker06/dc6976d2042b7b34a925 to your computer and use it in GitHub Desktop.
# put this in your staging.rb file. Obviously you'll need more config than this it's just an example.
Rails.application.configure do
config.action_mailer.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
config.autoload_paths += [config.action_mailer.preview_path]
routes.append do
get '/rails/mailers' => "rails/mailers#index"
get '/rails/mailers/*path' => "rails/mailers#preview"
end
end
# assuming you've configured your mail previews in your test folder this will work fine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment