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
In our project we are exploring using apotomo alongside another library. Unfortunately, both expose a helper method with the same name, "render_widget". As soon as I add the has_widgets declaration into any controller, the render_widget helper of the other library gets overridden by apotomo's definition, which breaks everything.
It is of course a general problem with Rails helpers that they all end up polluting the same namespace, and somewhat ironically Nick blogged about this two years ago. :)
I wonder if there is any sort of workaround, or if it could be envisioned to rename the helper into something at least somewhat more namespaced ("widget" is a quite generic term).
I realise that this is kind of a bold feature request, but I think that in the spirit of that original blog post such an issue ought to be addressed at least in some way.
The text was updated successfully, but these errors were encountered:
In future versions of Cells (and Apotomo) you will have a more object-oriented access to the API, e.g. in views you will have an instance of your widget.
apotomo_widget(:song).show
I can have a quick look at how/when we import the helpers into the global namespace, I have an idea for an easy work-around.
In our project we are exploring using apotomo alongside another library. Unfortunately, both expose a helper method with the same name, "render_widget". As soon as I add the has_widgets declaration into any controller, the render_widget helper of the other library gets overridden by apotomo's definition, which breaks everything.
It is of course a general problem with Rails helpers that they all end up polluting the same namespace, and somewhat ironically Nick blogged about this two years ago. :)
I wonder if there is any sort of workaround, or if it could be envisioned to rename the helper into something at least somewhat more namespaced ("widget" is a quite generic term).
I realise that this is kind of a bold feature request, but I think that in the spirit of that original blog post such an issue ought to be addressed at least in some way.
The text was updated successfully, but these errors were encountered: