views:

23

answers:

1

I have a view, which wants to consume information from a presentation model. This model contains among other things, a collection of ActiveRecord objects.

I would like to not expose the entire collection to the models consumers, but instead wish to only expose the 'data' part.

I expect that I can write a method to create a data-only copy of this complex object, but I'll be honest, I don't really want to.

Is it a terrible idea for me to just expose the entire collection object (yeah, along with all its extra methods and properties...and potential for badness)?

Or, maybe, there's a better approach to dealing with this kind of scenario? I'm sure I'm not the first guy to run into this.

--Brian

A: 

I do not think exposing control calls to a view is always bad. Here is sounds like it would be a simpler solution to do so than creating the data proxies (data proxies can have errors, get out of date, and create code duplication).

John Uckele
Thanks for affirming my instinct on this one. I too felt like the whole data-proxy thing was just a nightmare waiting to be dreamt.
reidLinden