Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Conversation

@ashervb
Copy link

@ashervb ashervb commented May 18, 2018

If routes are being pulled in via another Engine, the map_app.url_for can fail resulting in a ActionController::UrlGenerationError error

@aaronrussell
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants