Is there a way to code a rails partial such that it can only be rendered once, no matter how many times the containing view attempts to render it?
Why:
You could make use of the instance variables. However, you have to ensure that the instance variables is bounded to the views only and will not be crashed.
Something like:
# in your view
<% @widget_partial_rendered_popovers ||= [] %>
<% popover_partials.each do |pp| %>
<% if !@widget_partial_rendered_popovers.include?(pp) %>
<% @widget_partial_rendered_popovers << pp %>
display the popover
<% end %>
<% end %>
If you are able to collect the popover things early in the controller, it would be cleaner to just render all the popovers in a place. As I don't know what's your exact structure is, I could just give you what you have required.