push_type
push_type copied to clipboard
Fix conflicts with apps using multiple engines
If routes are being pulled in via another Engine, the map_app.url_for
can fail resulting in a ActionController::UrlGenerationError
error
Hi thanks for the PR, and sorry for keeping you waiting.
I currently can't merge this. The patch was originally introduced so that kaminari could be used in both pushtype and the main app - discussed here kaminari/kaminari#322. I think your PR will reintroduce that issue.
It seems what we actually need is something like:
begin
@template.push_type_admin.url_for arguments
rescue
begin
base_page_url_for(page)
rescue
@template.main_app.url_for arguments
end
end
... even if that is the ugliest code I've ever written :trollface: I'm open to any suggestions, just need to make sure all bases are covered. Also need to be mindful that kaminari are apparently working on a refactor that will change all this.