You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a lot of logic in the main header to split the behaviour of the page depending on the page that we send to it. This if/else logic is tightly coupled to types. We already abstracted types by creating separate page classes for each type of page, so this logic is in the wrong place.
We also have some logic at the top of the layout.erb template to check for the presence of variables that are present only for some pages. These are there due to the header logic as well.
Proposed Solution
For now I think we should just move the header to the pages templates, and adapt it to each page, since the header is different depending on the type of page we are in. We will have some repetition, but that can be solved once we make the repetition obvious and find the right pattern.
Acceptance Criteria
There is no logic in the main header and each page template has a dedicated header, and there is no variable logic at the top of the layout.erb.
The text was updated successfully, but these errors were encountered:
Problem
We have a lot of logic in the main header to split the behaviour of the page depending on the page that we send to it. This
if
/else
logic is tightly coupled to types. We already abstracted types by creating separatepage
classes for each type of page, so this logic is in the wrong place.We also have some logic at the top of the
layout.erb
template to check for the presence of variables that are present only for some pages. These are there due to the header logic as well.Proposed Solution
For now I think we should just move the header to the pages templates, and adapt it to each page, since the header is different depending on the type of page we are in. We will have some repetition, but that can be solved once we make the repetition obvious and find the right pattern.
Acceptance Criteria
There is no logic in the main header and each page template has a dedicated header, and there is no variable logic at the top of the
layout.erb
.The text was updated successfully, but these errors were encountered: