# Using multiple controllers in one view

**URL:** <https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081>\
**Category:** Rails\
**Created:** [August 17, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081 "2008-08-17T15:05:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dstocks](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dstocks](https://www.ruby-forum.com/u/dstocks)\
**Post date:** [August 17, 2008, 3:05pm UTC](https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081/1 "2008-08-17T15:05:26Z")

</div>

HELP!

I am trying to build a site for a client where they can display their  
art, sell their art, and update the front page in a blog style format.  
I have one main controller for the site itself, a controller for the  
displaying of their art, a controller for a message board, and a  
controller for their cart. I want to:

A) Place the content of the update controller on the front page of my  
site controller.  
B) Create an Admin page where she can access the  
creating/updating/deleting functions of all of her different items.

How can I do this?

Don

---

<div class="post-metadata">

**Author:** ![dstocks](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/48db29/32.png) [@dstocks](https://www.ruby-forum.com/u/dstocks)\
**Post date:** [August 17, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/using-multiple-controllers-in-one-view/146081/2 "2008-08-17T18:35:00Z")

</div>

You can’t call more than one controller per action. Rails works by  
dispatching a reqest to one controller and calling one action. You’ll  
have to do everything you want from that action.

If you want to access the cart in a lot of places, you can write a  
private method in ApplicationController that loads the cart, call it  
‘load\_cart’, and then use a before\_filter :load\_cart in the places you  
want to load the cart.

You can link to any action you want from any view. You can create an  
admin page that lists items and links to the CRUD functions for those  
items without problem.

On Aug 17, 9:05 am, Don S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
