I have made a common class and put it to the /lib folder of my Rails
Now I have some problems with access to:
Call to SupportMailer.send_activation_email gives an error:
NoMethodError (undefined method `send_activation_email’ for
Ok, I have changed my SupportMailer class - give a prefix to the
function send_activation_email -> function self.send_activation_email
But in this case the Mailer doesn’t see other models and gives an
NoMethodError (You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.=):
How can I access mailers?
- Functions from application.rb
I have added a function (send_sms) to the ApplicationController, but
how can I access it from common class in /lib folder?
I have tried:
But in both cases I have got NoMethodError
How can I access this global function?
I’m lost in all the dependencies and don’t know where to place global
functions and classes and how to connect from them to another parts of