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

include of ActionView::Helpers::FormTagHelper changes the url_for implementation #5

Open
rocket-turtle opened this issue Aug 13, 2024 · 0 comments

Comments

@rocket-turtle
Copy link
Contributor

rocket-turtle commented Aug 13, 2024

when we include ActiveHashcash in our controller ActionView::Helpers::FormTagHelper gets automatically included as well. That changes the url_for and leads to some problems on our side.

https://github.com/BaseSecrete/active_hashcash/blob/0.4.0/lib/active_hashcash.rb#L7

with include ActiveHashcash

> SubscriptionsController.new.method('url_for')
 => #<Method: SubscriptionsController(ActionView::Helpers::UrlHelper)#url_for(options=...) .../actionview-6.1.7.8/lib/action_view/helpers/url_helper.rb:33>
> SubscriptionsController.methods.count
 => 421

without include ActiveHashcash

> SubscriptionsController.new.method('url_for')
 => #<Method: SubscriptionsController(ActionDispatch::Routing::UrlFor)#url_for(options=...) .../actionpack-6.1.7.8/lib/action_dispatch/routing/url_for.rb:170>

> SubscriptionsController.methods.count
 => 395

I think a fix would be to generate the hidden_field_tag via the view_context.

Do you except pull requests? That should fix it: #6

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