I use gem props_template and I need to render array with some partial and additional local, I use something like
json.array! @orders, partial: ['shared/order', locals: {employee: current_employee}, as: :order] do
end
and inside of partial
json.iid order.iid
But it returns list of the same iids from one of the orders (with any partial attributes - all elements in response will be the same from one of the elements)
[{ 'iid' => 1 }, { 'iid' => 1 }, { 'iid' => 1 }]
if remove locals - everything works fine and iids are different
I forked repository, added test for such case, and it fails because renders the same elements
I have 2 questions
as: :order
then what is variable name inside partial for accessing array element?There was bug in gem, it is fixed in commit.
Right now partials can be correctly rendered with locals variables