ruby on rails - undefined method `default' for ActionMailer -


i'm having weird error rails 5 action mailer.

# app/mailers/application_mailer.rb class applicationmailer < actionmailer::base   default from: "from@example.com"   layout 'mailer' end 

irb

~/workspace/rails5 > rails c       ruby-2.4.1@rails5 running via spring preloader in process 45498 loading development environment (rails 5.1.2) 2.4.1 :001 > applicationmailer      nameerror: uninitialized constant mail::testmailer      app/mailers/application_mailer.rb:1:in `<top (required)>'      (irb):1 2.4.1 :002 > applicationmailer      nomethoderror: undefined method `default' applicationmailer:class      app/mailers/application_mailer.rb:3:in `<class:applicationmailer>'      app/mailers/application_mailer.rb:1:in `<top (required)>'      (irb):2 2.4.1 :003 > 

this default scaffold of rails 5.

two weird things happen first tells me uninitialized constant trows default not method right after.

just wondering how fix or if should downgrade rail 5.0

the solution turned out if have model named mail actionmailer grab 1 first instead of rails class. if happens fails first time second time load rails class , try , smash them together. allowing submodule work treating main class monkey path.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -