From: Andy Allan Date: Wed, 7 Aug 2024 15:12:53 +0000 (+0100) Subject: Merge pull request #5044 from mmd-osm/patch/rn1 X-Git-Tag: live~252 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/2a649d16df01bcc49ce99c282e9bfbe44063cd9d?hp=4c00c57c0b915bcf0ca743799b195295a438779e Merge pull request #5044 from mmd-osm/patch/rn1 JSON partial rendering in loop --- diff --git a/app/views/api/changesets/index.json.jbuilder b/app/views/api/changesets/index.json.jbuilder index f52d69865..ce094fa34 100644 --- a/app/views/api/changesets/index.json.jbuilder +++ b/app/views/api/changesets/index.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.changesets(@changesets) do |changeset| - json.partial! changeset +json.changesets do + json.array! @changesets, :partial => "changeset", :as => :changeset end diff --git a/app/views/api/messages/inbox.json.jbuilder b/app/views/api/messages/inbox.json.jbuilder index 524006ded..122a82495 100644 --- a/app/views/api/messages/inbox.json.jbuilder +++ b/app/views/api/messages/inbox.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.messages(@messages) do |message| - json.partial! message +json.messages do + json.array! @messages, :partial => "message", :as => :message end diff --git a/app/views/api/messages/outbox.json.jbuilder b/app/views/api/messages/outbox.json.jbuilder index 524006ded..122a82495 100644 --- a/app/views/api/messages/outbox.json.jbuilder +++ b/app/views/api/messages/outbox.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.messages(@messages) do |message| - json.partial! message +json.messages do + json.array! @messages, :partial => "message", :as => :message end diff --git a/app/views/api/notes/index.json.jbuilder b/app/views/api/notes/index.json.jbuilder index 7909391f5..5660a8ad5 100644 --- a/app/views/api/notes/index.json.jbuilder +++ b/app/views/api/notes/index.json.jbuilder @@ -1,5 +1,5 @@ json.type "FeatureCollection" -json.features(@notes) do |note| - json.partial! note +json.features do + json.array! @notes, :partial => "note", :as => :note end diff --git a/app/views/api/users/index.json.jbuilder b/app/views/api/users/index.json.jbuilder index 1ad07d47c..d2dbd4d4f 100644 --- a/app/views/api/users/index.json.jbuilder +++ b/app/views/api/users/index.json.jbuilder @@ -1,5 +1,5 @@ json.partial! "api/root_attributes" -json.users(@users) do |user| - json.partial! user +json.users do + json.array! @users, :partial => "user", :as => :user end