2

I am using rails 5 and wanted to see the /rails/mailers url in production mode under the authentication. I am able to implement authentication under the URLs but I can only see a blank page on production(Heroku, review app) but on local I can see the complete page without any issues. I tried production mode on local as well and that was also working fine. Running out of ideas in that direction. Thanks in advance.

Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39

2 Answers2

1

I got to know, We are not pushing the spec directory to Heroku, hence there is an empty list of the previews and not able to view any preview at all.

Nishutosh Sharma
  • 1,926
  • 2
  • 24
  • 39
1

If you use Heroku beware of your .slugignore, you might have 'spec/' in it.

If it is the case, as spec/mailers/previews doesn't exist on heroku instance, you've got a blank page as a result (status 200).

Also note that unlike .gitignore, .slugignore does not support negated ! patterns.

Here is my workaround :
1.move previews away from spec/, to app/mailers/
2.

#environment.rb
...

Rails.application.configure do
  config.action_mailer.preview_path = "#{Rails.root}/app/mailers/previews"
end
Max Press
  • 111
  • 1
  • 6