stephenallred wrote:
> 
> Also, how does one go about having a view that's backed by multiple
> models and controllers in Rails (taking the Basecamp landing page as
> an example, how would it work if each bit of prose was a model
> controller pair)?
> 
> Many thanks,
> Steve

Don't forget that a controller can marshal data from any old models it 
desires...

For an intranet app I have, the 'landing' page shows 4 separate partials 
driven off different models: internal news items, and key values from 
the most recently updated records from 4 different areas of the 
application.

So the landing page 'index' method body retrieves data something like 
this:

@recent_news = News.find(blah blah blah)
@recent_projects = Project.find(blah blah blah)
@recent_mrds = Mrd.find(blah blah blah)
@recent_scenarios = Scenario.find(blah blah blah)

Then the index.html.haml view simply invokes the appropriate partial for 
each list.
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to