This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
more specifically, i hate the way we use them at work. They're such a mess, but any protest from me falls on deaf ears because 'it's idiomatic'.
Basically, some of the page content - typically static content like headers or footers will be in the Layout, some will be in the view template. the thing is where the division is is kinda arbitrary: H1 ? Lead para ? who knows. to facilitate reuse everything ends up being conditional, maybe with multiple versions; multiple headers, multiple footers. the 'content' template then has to configure the Layout.
(IMO it would just be more direct to call a helper method, or something, in the main template to include what you need.)
But then layouts proliferate when it's not obvious if you can configure the Layout to do what you want.
Worst of all, the content Template is then tightly coupled to the layout, so the whole thing is a bit pointless. view tests don't work, pages break unintentionally.
Any one else find this a crap way of doing it? or just me?
Subreddit
Post Details
- Posted
- 9 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/rails/comme...