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

partial.helpers are shared across all partials #102

Open
grncdr opened this issue Sep 3, 2024 · 1 comment
Open

partial.helpers are shared across all partials #102

grncdr opened this issue Sep 3, 2024 · 1 comment

Comments

@grncdr
Copy link

grncdr commented Sep 3, 2024

I'm not sure if this is an issue or if I'm misreading the README, but from "well isolated helper methods" I expected that helpers defined with partial.helpers would only be available to the partial that defines them. Instead, it appears that helpers defined in this way are available to all partials.

To reproduce:

  1. Clone https://github.com/grncdr/nice_partials_issue
  2. Checkout the issue-102 branch
  3. bundle && rails server
  4. Open localhost:3000
  5. Observe the empty red box
  6. Uncomment this line: https://github.com/grncdr/nice_partials_issue/blob/issue-101/app/views/pages/index.html.erb#L2
  7. Refresh*
  8. Observe that the helper defined in test_partial is available on other_partial.

* - you may need to restart the server to observe the changes, see #101

@kaspth
Copy link
Contributor

kaspth commented Sep 3, 2024

Yeah, we're aware of this, but I haven't found a reliable way to fix it yet.

"isolated" there refers to having the helpers scoped just to partials, versus also having helper SomethingHelper expose them elsewhere.

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