The method in list_helper.rb is more complete, providing proper styling and functionality. However, the method in filter_helper.rb is simpler and lacks the necessary styling, leading to potential issues when developers use it inadvertently.
Background
As of the pull request fix: fixes syntax error in filter_helper #61 , the syntax error in filter_helper.rb was fixed, but the fundamental issue of having two list_item methods remains unresolved. It is not clear which helper method should be used or intended to be used, causing confusion.
Problem
Confusion: Developers are unsure which list_item method to use.
Incomplete Styling: The list_item method in filter_helper.rb does not apply any styling, leading to inconsistent UI when used.
Dependencies: The _filter.html.erb view does not use render_list as a partial, making it unclear that the filter component depends on the list component.
Redundancy: Having two similar methods creates redundancy and maintenance overhead.
Proposal
We need to decide on a single list_item method to be used across the application. Given that the list_helper.rb method is more complete and functional, it would be logical to adopt this as the standard.
Two possible solutions:
Adopt the list_item Method from list_helper.rb:
Update all instances to use the list_item method from list_helper.rb.
Deprecate and remove the list_item method from filter_helper.rb.
Use render_list Method Inside Filter Component View Partial:
Ensure the _filter.html.erb view uses render_list as a partial to indicate the dependency on the list component.
Evaluate if the list_item method in filter_helper.rb is necessary if the intended component to be used is list and its helper.
Request for Feedback
I am willing to make the necessary changes after addressing the intent and further plans for this issue. Please provide feedback on:
Which list_item method should be adopted as the standard?
Should we deprecate the list_item method in filter_helper.rb?
Is it preferable to use render_list in the filter component view partial to clarify dependencies?
Once a decision is made, I can proceed with the implementation.
Description
Currently, there are two
list_item
helper methods in the codebase, leading to confusion and potential misuse:filter_helper.rb
:list_helper.rb
:The method in
list_helper.rb
is more complete, providing proper styling and functionality. However, the method infilter_helper.rb
is simpler and lacks the necessary styling, leading to potential issues when developers use it inadvertently.Background
As of the pull request fix: fixes syntax error in filter_helper #61 , the syntax error in
filter_helper.rb
was fixed, but the fundamental issue of having twolist_item
methods remains unresolved. It is not clear which helper method should be used or intended to be used, causing confusion.Problem
list_item
method to use.list_item
method infilter_helper.rb
does not apply any styling, leading to inconsistent UI when used._filter.html.erb
view does not userender_list
as a partial, making it unclear that the filter component depends on the list component.Proposal
We need to decide on a single
list_item
method to be used across the application. Given that thelist_helper.rb
method is more complete and functional, it would be logical to adopt this as the standard.Two possible solutions:
Adopt the
list_item
Method fromlist_helper.rb
:list_item
method fromlist_helper.rb
.list_item
method fromfilter_helper.rb
.Use
render_list
Method Inside Filter Component View Partial:_filter.html.erb
view usesrender_list
as a partial to indicate the dependency on the list component.list_item
method infilter_helper.rb
is necessary if the intended component to be used islist
and its helper.Request for Feedback
I am willing to make the necessary changes after addressing the intent and further plans for this issue. Please provide feedback on:
list_item
method should be adopted as the standard?list_item
method infilter_helper.rb
?render_list
in the filter component view partial to clarify dependencies?Once a decision is made, I can proceed with the implementation.