Ruby on Rails Thursday, August 12, 2010

Norm Scherer wrote:
> Marnen Laibow-Koser wrote:
>>> def new
>> only make @comment available.
>>
> And of course if you just had @post you could easily extract comments in
> the view code by @post.comments.build.

But you shouldn't. That's too much logic for the view.

> @comment is really not necessary
> because @post gives you the handle you need.

Wrong. If you care about MVC, you shouldn't be building objects in the
view layer. (If you don't care about MVC, you shouldn't be using
Rails.)

>
> Norm

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org

Sent from my iPhone
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment