[openstreetmap/openstreetmap-website] Refactor traces georss description partial (Issue #4596)

Andy Allan notifications at github.com
Wed Mar 20 12:11:30 UTC 2024


While reviewing #4595 I spotted a few things that could be improved with the [`traces/_description`](https://github.com/openstreetmap/openstreetmap-website/blob/3b1fb1c73bf1c82e29ecc8bf33e64f7985c4a8c0/app/views/traces/_description.html.erb) partial:

* It uses a relative path for the icon image, but this partial is used for rss feeds. It should probably be a fully qualified url
* the trace object is passed in, but without an alias. This means that we have e.g. `description.user` which is confusing, since `description` is a Trace object here. We should do something like `render(:partial => "description", :object => trace, :as => "trace")` or similar, or with passing a locals array
* I think we can avoid the trailing `.id` on the object passed to the path method

Overall, `trace_icon_path(description.user, description.id)` could end up something like `trace_icon_url(trace.user, trace)`

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

Message ID: <openstreetmap/openstreetmap-website/issues/4596 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240320/797557c5/attachment.htm>


More information about the rails-dev mailing list