# Virtual controller

**URL:** <https://www.ruby-forum.com/t/virtual-controller/108752>\
**Category:** Rails\
**Created:** [July 6, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/virtual-controller/108752 "2007-07-06T18:19:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ara.t.howard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a8b319/32.png) [@ara.t.howard](https://www.ruby-forum.com/u/ara.t.howard)\
**Post date:** [July 6, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/virtual-controller/108752/1 "2007-07-06T18:19:10Z")

</div>

anyone have thoughts on how a library could mount an action to a  
route _without_ messing with routes.rb or generating an actual  
controller?

something along the lines of

class ActionController::Base  
def global() render :text =\> ‘42’ end  
end

ActionController::Routing::Routes.add\_route ‘/global’, …

??

in otherwords have a library mount an action to a route without  
generating code or editing files.

cheers.

## -a

we can deny everything, except that we have the possibility of being  
better. simply reflect on that.  
h.h. the 14th dalai lama
