# Create controller dynamically?

**URL:** <https://www.ruby-forum.com/t/create-controller-dynamically/196653>\
**Category:** Ruby\
**Created:** [April 24, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/create-controller-dynamically/196653 "2008-04-24T16:37:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varunkumargoel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ed8c4c/32.png) [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Post date:** [April 24, 2008, 4:37pm UTC](https://www.ruby-forum.com/t/create-controller-dynamically/196653/1 "2008-04-24T16:37:56Z")

</div>

Hi All,  
I wanna create controller dynamically through my ruby code.

Please help me out.

Suppose i have one controller if i call a function of this controller so  
i wanna create another controller dynamically.That can be one or n  
numbers of controllers.

Please help me …  
Thanks  
Varun

---

<div class="post-metadata">

**Author:** ![varunkumargoel](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/ed8c4c/32.png) [@varunkumargoel](https://www.ruby-forum.com/u/varunkumargoel)\
**Post date:** [April 24, 2008, 4:53pm UTC](https://www.ruby-forum.com/t/create-controller-dynamically/196653/2 "2008-04-24T16:53:42Z")

</div>

On Thu, Apr 24, 2008 at 8:37 AM, Varun G.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> ## Thanks Varun
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

You really probably want to post this on the rails list. It is probably  
do-able but the structure of rails puts it a bit beyond the scope of  
just  
ruby. You will have to dynamically define classes but with rails  
assuming  
those classes will be in separate files you might have to do some  
significant unpleasantness.

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I can’t hear a word you’re saying.”

-Greg Graffin (Bad Religion)
