Skip to content

Loading problems with helpers #42

@stiig

Description

@stiig

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions