Open alfuken opened 11 years ago
You can use a key
method.
array prices do |price|
key price.currency, price.value
end
@RKushnir nah, too late, I've switched to jbuilder gem already. Not so pretty, but works great, written by rails core, and supports partials out of the box.
@alfuken I understand you :)
I have a list of prices for a product
and want to render it like this:
Problem is, array of prices is not always the same - it may or may not have other currencies, there can be 10, there can be 1, there can be none at all. I've spent whole day trying to figure out, how do I handle anything other than plain array, and couldn't find a clue. So my question is: how do I do this?