using multiple controllers in one view


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?


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.