I prefer using [1] when there are lots of views that shares the same
div#id.
When there is another which changes the style, I only add a wrapper. If
there should be another div, I use a content_for in the views.
Practically they are same.
I think [1] is more DRY.
But I feel kinda weird with [1] because the wrapper div is separated
from the real content.
Option 1 is better. The wrapper div, if it’s constant, should be
separated from the content – it’s not a part of the content any more
than a static header or footer would be.
The second one [2] is ideal in situations where your
layouts/application.html.erb will be used to render different partials
with
varied div ids (for whatever reason). Still you can have a “parent div”
in
your layout template.
“A more radical argument for [statistical Natural Language Processing]
is
that human cognition is probabilistic and that language must therefore
be
probabilistic too since it is an integral part of cognition.” – Chris
Manning (1999), Foundations of Statistical Natural Language
Processing.