Rails: undefined local variable or `request 'method for

I have a mailer class that a remote user wants to receive. I appeal to him through request.env['REMOTE_USER'], but I receive request not defined error. I thought I could use the query anywhere?

undefined local variable or method request for my mail program

+3
source share
1 answer

Why don't you try loading the remote user into your controller action and storing it in db or redis when compiling your mail program


Inquiry

The problem, as Vimsha stated, is that you cannot access parameters requestoutside the foreground code

Rails, ?, , (IE ..)


, , , ,

(DRY) Rails , , , .

db ( redis, ),

+2

All Articles