[Rails] Re: Best Practices question regarding views & controllers

Anthony Green
Fri, 03 Mar 2006 15:40:57 -0000

> Where do you usually draw the line? Is it okay to, say, loop through an
> array of hashes that represents table column names and whether they need
> a certain colspan and build the table according to that?

That would be fine, if the table headers were hardcode into the view it
wouldn''t.

The way I understand it the view should contain as little
''control''
coding whilst still allowing for Agile development.

So iterating through a hash/array is fine but filtering out elemnts on
some basis isn''t - that should be done in the controller or model.

I don''t think the Agile book is the best place to learn about these
concepts. Tony Marstons written some easy intros to MVC. To progress
beyond the basics I''d look at some of the threads on Sitepoint.

_tony

--
Posted via http://www.ruby-forum.com/.