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

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

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?

Yes, slurpy, thats kind of what im thinking.

Surely theres a solution to this? a good one?