Nesting content from multiple controllers

Hi guys.

Here’s something I’ve been struggling with for a while: if you want to
nest a login box on, say, a welcome page, but the login stuff is
handled by the login controller while the welcome page is the welcome
controller, what are your options? Iframe?

Krister

why would you need iframes ? a page can show as many objects from as
many
models as you like. just try it. load the objects in your welcome
controller, thats all


Heri R.
http://sprinj.com

thanks for the reply.

im talking about controller logic, not models. if login is handled by
functions on the login controller, other than putting that logic in the
application.rb controller, how can you integrate login functionality
on a page associated with a different controller?

On 11/3/06, kristersaurus [email protected] wrote:

thanks for the reply.

im talking about controller logic, not models. if login is handled by
functions on the login controller, other than putting that logic in the
application.rb controller, how can you integrate login functionality
on a page associated with a different controller?

I control these things via a partial. You probably want to make any
variables that the login forms needs via a before_filter if you need
that.

If you wanted ajaxy login included on other pages, then use the
responds_to
in your login method of the login controller to provide the correct
output.

Hope that helps

Yes, slurpy, thats kind of what im thinking.

Surely theres a solution to this? a good one?

You can’t really use partials that involve the login controller from a
view driven by the welcome controller. render :partial doesn’t allow
you to specify another controller. You’d have to use render_component,
and then we’re talking about using components, which is supposedly evil
& slow.

Right?