Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New rails 4.1 mailer preview action not found error

Rails has 607 open issues...so, rather than plugging that hole even more I though Id try here first. I have upgraded to 4.1 and am implementing rails mailer previews. I tried upgrading my existing mailer and adding tests/mailers/previews directory. When that gave the following error I tried generating a new mailer. Same error.

 class NotifierPreview < ActionMailer::Preview     def welcome       Notifier.welcome(User.first)     end   end 

results in this error:

 The action 'notifier' could not be found for Rails::MailersController 

I've tried searching google, the docs, stack overflow, but nothing eludes to this error.

Anyone experience this or have any ideas?

like image 446
hellion Avatar asked Jun 09 '14 02:06

hellion


1 Answers

The default preview path is /test/mailers/previews but rspec will override this to be /spec/mailers/previews

You can set the path to be whatever you like with:

config.action_mailer.preview_path = "#{Rails.root}/test/mailers/previews" 
like image 183
Calvin Avatar answered Sep 22 '22 22:09

Calvin