NeatNit left a comment (openstreetmap/openstreetmap-website#5883)

Okay, seems like I was looking in the wrong places. Those rich text linkify 
calls do call the function in the parent class.

The linkify defined in ApplicationHelper is called from other places. In that 
case, is it really a good idea to define effectively the same method but with 
subtle differences in separate places, and give it exactly the same name? 
Perhaps one can be made an alias of the other?

The helpful folks over at the Ruby Discord server helped me figure this out:

> my guess: you're getting confused as to who is calling what. The `linkify` 
> calls in `rich_text.rb` are calling each other whereas the `linkify` calls in 
> app are not calling the linkify methods in `rich_text.rb`...  I mostly see 
> this as very bad naming and that should be addressed.
> 
> Here's all the views and the calls to the helpers' `linkify`:
> 
> ```
> app/helpers/application_helper.rb
> 4:  def linkify(text)
> 
> app/helpers/browse_tags_helper.rb
> 43:      safe_join(value.split(";", -1).map { |x| linkify(h(x)) }, ";")
> 
> app/views/changesets/show.html.erb
> 7:    <%= linkify(@changeset.tags["comment"].to_s.presence || 
> t("browse.no_comment")) %>
> 
> app/views/changesets/index.atom.builder
> 66:                      tag_tr.td "#{tag[0]} = #{linkify(tag[1])}"
> 
> app/views/browse/_common_details.html.erb
> 12:    <%= linkify(common_details.changeset.tags["comment"]) %>
> ```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5883#issuecomment-2778332416
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/issues/5883/2778332...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to