# Methodaccess from GeneralMailer to ApplicationController

**URL:** <https://www.ruby-forum.com/t/methodaccess-from-generalmailer-to-applicationcontroller/125835>\
**Category:** Rails\
**Created:** [January 12, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/methodaccess-from-generalmailer-to-applicationcontroller/125835 "2008-01-12T17:48:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lpp-rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@lpp-rob](https://www.ruby-forum.com/u/lpp-rob)\
**Post date:** [January 12, 2008, 5:48pm UTC](https://www.ruby-forum.com/t/methodaccess-from-generalmailer-to-applicationcontroller/125835/1 "2008-01-12T17:48:21Z")

</div>

Hallo,

i defined a method (foo) in my application.rb, which inherits from  
ActionController::Base) how do i access this method from my  
GeneralMailer \< ActionMailer::Base?

thx

---

<div class="post-metadata">

**Author:** ![lpp-rob](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@lpp-rob](https://www.ruby-forum.com/u/lpp-rob)\
**Post date:** [January 12, 2008, 6:02pm UTC](https://www.ruby-forum.com/t/methodaccess-from-generalmailer-to-applicationcontroller/125835/2 "2008-01-12T18:02:14Z")

</div>

On 12 Jan 2008, at 16:48, Lpp Rob wrote:

> Hallo,
> 
> i defined a method (foo) in my application.rb, which inherits from  
> ActionController::Base) how do i access this method from my  
> GeneralMailer \< ActionMailer::Base?

You can’t since GeneralMailer doesn’t inherit from  
ApplicationController. You could however put foo in a module and  
include that module in both GeneralMailer and ApplicationController.

Fred
