Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading problems with helpers #42

Open
stiig opened this issue Jul 7, 2023 · 0 comments
Open

Loading problems with helpers #42

stiig opened this issue Jul 7, 2023 · 0 comments

Comments

@stiig
Copy link

stiig commented Jul 7, 2023

I added the library to the project and when I opened at the first time after loading a server a page /rake-ui and then try to open a page with code like that link_to(link_params) it raises an error

arguments passed to url_for can't be handled. Please require routes or provide your own implementation

but if I tried to open a page from the project after loading the project and then opened /rake-ui it works fine

I checked the path of invoking the function url_for and discovered that if you go through the first scenario it looks like

    From: ../gems/actionview-5.2.8.1/lib/action_view/helpers/url_helper.rb:32:
    Owner: ActionView::Helpers::UrlHelper
    Visibility: public
    Signature: url_for(options=?)
    Number of lines: 11

and in the second scenario

    From: ../gems/actionview-5.2.8.1/lib/action_view/routing_url_for.rb:7:
    Owner: ActionView::RoutingUrlFor
    Visibility: public
    Signature: url_for(options=?)
    Number of lines: 42

I tried to force my app to load these files in the ApplicationHelper this way

module ApplicationHelper
  include ActionView::Helpers::UrlHelper

and that way

module ApplicationHelper
  include Rails.application.routes.url_helpers

but it didn't work anyway

Rails: 5.2.8.1
Rake: 13.0.6
Rake-ui: 0.1.0

Ruby: ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-darwin21]
OS: MacOS 13.4.1 (22F82)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant