# Creating a controller object from a refrencse

**URL:** <https://www.ruby-forum.com/t/creating-a-controller-object-from-a-refrencse/108106>\
**Category:** Rails\
**Created:** [June 29, 2007, 2:01am UTC](https://www.ruby-forum.com/t/creating-a-controller-object-from-a-refrencse/108106 "2007-06-29T02:01:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [June 29, 2007, 2:01am UTC](https://www.ruby-forum.com/t/creating-a-controller-object-from-a-refrencse/108106/1 "2007-06-29T02:01:50Z")

</div>

Hi there.

I need to add a image to a given controlers imagepool. This is to be  
done from the image controller list action. This lists the images, and  
suplies a selectbox which contains the possible image pools and an “add”  
and “remove” button. When clicking f.x. “add” a Ajax.Request is made to

/image/addImageToController/imgId&cont=controller

Hov do i cache the selected controller, when its name is only passed as  
a string to the url. So that is is enterpreted as a true controller  
object?

- Emil

---

<div class="post-metadata">

**Author:** ![emuen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@emuen](https://www.ruby-forum.com/u/emuen)\
**Post date:** [June 29, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/creating-a-controller-object-from-a-refrencse/108106/2 "2007-06-29T15:03:28Z")

</div>

rails is so called “shared nothing” and the only valuable cache  
storage options you have is the session, which serializes the objects  
you have associated with it and the DB. Since each request might be  
catched by an another mongrel / rails instance, you can’t cache  
objects in controller instances or class variables.

On 29 Jun., 02:01, Emil K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
