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

Helpers not reloaded in development? #1069

Open
jdelStrother opened this issue Sep 11, 2021 · 2 comments
Open

Helpers not reloaded in development? #1069

jdelStrother opened this issue Sep 11, 2021 · 2 comments

Comments

@jdelStrother
Copy link

@jdelStrother jdelStrother commented Sep 11, 2021

If I have a ViewComponent that calls a helper method (eg from app/helpers/application_helper.rb), the helper is normally reloaded on each page load, as expected.

However, if I load the preview page (eg http://localhost:3000/rails/view_components/example_component/default), the helper methods appear to be the helpers as they were at application-boot-time. Changes to app/helpers/application_helper.rb have no effect, and I have to restart my rails server before they're picked up.

Changes to the view-component code (eg app/components/example_component.rb) do get reloaded, however.

Is this expected behaviour? Some side-effect of inheriting the preview controller from Rails::ApplicationController?

@joelhawksley
Copy link
Contributor

@joelhawksley joelhawksley commented Sep 17, 2021

@jdelStrother interesting! Would you be up for writing an integration test that reproduces this behavior?

@jdelStrother
Copy link
Author

@jdelStrother jdelStrother commented Sep 20, 2021

@joelhawksley sure, try #1075 ?

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

2 participants