You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a tabbed UI where a CREATE action can add tabs. The tabs are dynamically loaded using render_async when the user clicks on the tab label. Consider something like this...
Each tab is loaded asynchronously, so the view layout contains:
= content_for(:render_async)
However, because the CREATE function can add a new tab to the UI, the asynchronous view partial also contains:
= content_for(:render_async)
This is causing duplication of the injected Javscript when the view is rendered because it is being injected at the layout level and within the partial for each tab.
Possible solution: what if the render_async method accepted an option to specify the content tag? This would provide control over where the injected Javascript would go. Of course, the option would default to :render_async for backward compatibility. I will experiment with this on my fork and offer a PR if I can get something working.
The text was updated successfully, but these errors were encountered:
vanboom
pushed a commit
to vanboom/render_async
that referenced
this issue
May 15, 2020
I have a tabbed UI where a CREATE action can add tabs. The tabs are dynamically loaded using render_async when the user clicks on the tab label. Consider something like this...
Each tab is loaded asynchronously, so the view layout contains:
= content_for(:render_async)
However, because the CREATE function can add a new tab to the UI, the asynchronous view partial also contains:
= content_for(:render_async)
This is causing duplication of the injected Javscript when the view is rendered because it is being injected at the layout level and within the partial for each tab.
Possible solution: what if the
render_async
method accepted an option to specify the content tag? This would provide control over where the injected Javascript would go. Of course, the option would default to:render_async
for backward compatibility. I will experiment with this on my fork and offer a PR if I can get something working.The text was updated successfully, but these errors were encountered: