# ActionController::Base.send :include, etc

**URL:** <https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091>\
**Category:** Rails\
**Created:** [January 19, 2009, 10:19am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091 "2009-01-19T10:19:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 19, 2009, 10:19am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091/1 "2009-01-19T10:19:05Z")

</div>

Hi  
In one of the method say  
require\_helpers

i have the code  
helper\_constant = SomeHelper  
ActionController::Base.send :include, helper\_constant  
ActionView::Base.send :include, helper\_constant  
ActionView::Helpers::FormBuilder.send :include, helper\_constant

```
 And I did not understand what actually the above does?

```

Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 21, 2009, 7:00am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091/2 "2009-01-21T07:00:03Z")

</div>

i think this topic will help you.  
[http://www.rubycentral.com/pickaxe/tut\_modules.html](http://www.rubycentral.com/pickaxe/tut_modules.html)  
Section : Mixins

Sijo Kg wrote:

> Hi  
> In one of the method say  
> require\_helpers
> 
> i have the code  
> helper\_constant = SomeHelper  
> ActionController::Base.send :include, helper\_constant  
> ActionView::Base.send :include, helper\_constant  
> ActionView::Helpers::FormBuilder.send :include, helper\_constant
> 
> ```
> And I did not understand what actually the above does?
> 
> ```
> 
> Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 21, 2009, 7:17am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091/3 "2009-01-21T07:17:28Z")

</div>

and see following codes:

module MyTools  
def run(\*args)  
puts “let #{args.join(’ ')} run”  
end  
end

class TryTools  
#include MyTools  
def initialize()  
self.class.send :include,MyTools  
end  
end

c=TryTools.new  
c.run(“me”)

Roscus Farmer wrote:

> i think this topic will help you.  
> [http://www.rubycentral.com/pickaxe/tut\_modules.html](http://www.rubycentral.com/pickaxe/tut_modules.html)  
> Section : Mixins
> 
> Sijo Kg wrote:
> 
> > Hi  
> > In one of the method say  
> > require\_helpers
> > 
> > i have the code  
> > helper\_constant = SomeHelper  
> > ActionController::Base.send :include, helper\_constant  
> > ActionView::Base.send :include, helper\_constant  
> > ActionView::Helpers::FormBuilder.send :include, helper\_constant
> > 
> > ```
> > And I did not understand what actually the above does?
> > 
> > ```
> > 
> > Sijo

---

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [January 21, 2009, 7:42am UTC](https://www.ruby-forum.com/t/actioncontroller-base-send-include-etc/158091/4 "2009-01-21T07:42:40Z")

</div>

Hi  
Thanks for the reply  
Sijo
