active_hashcash icon indicating copy to clipboard operation
active_hashcash copied to clipboard

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

Open rocket-turtle opened this issue 1 year ago • 0 comments

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: https://github.com/BaseSecrete/active_hashcash/pull/6

rocket-turtle avatar Aug 13 '24 10:08 rocket-turtle