Reputation: 944
So I come across with a problem where I would like to save a partial as an html string and render another partial with that string but I keep getting a double render error
def fruits
fruits = Fruits.all
market_html = "#{render partial: 'market', locals: {fruits: fruits}}"
render partial: 'super_market', locals {market_html: market_html}
end
Upvotes: 0
Views: 234
Reputation: 23317
Do you want render_to_string
?
market_html = render_to_string partial: 'market', locals: {fruits: fruits}
Upvotes: 2