ambethia / recaptcha

ReCaptcha helpers for ruby apps
http://github.com/ambethia/recaptcha
MIT License
1.97k stars 439 forks source link

recaptcha pjax not working #151

Open lustremedia opened 8 years ago

lustremedia commented 8 years ago

I am trying to use the recaptcha gem with rails and pjax. But upon any pjax call, the widget does not load. Further I find the documentation on how to add the options to the recaptcha_tags insufficient. e.g. I have tried to add ajax support the following way:

<%= recaptcha_tags options: { ajax: true }  %>
<%= recaptcha_tags ajax: true  %>
<%= recaptcha_tags { ajax: true }  %>

none of which are working, and some are not working. Are the ajax callbacks sufficient enough to work with the pjax callbacks? Is there a workaround, except needing to implement the recaptcha api plain from google?

grosser commented 8 years ago

I'd think you have to add ajax to the options that get passed through inside of the tags_helper, can you try this / make a PR ?

On Thu, Dec 10, 2015 at 4:20 AM, lustremedia notifications@github.com wrote:

I am trying to use the recaptcha gem with rails and pjax. But upon any pjax call, the widget does not load. Further I find the documentation on how to add the options to the recaptcha_tags insufficient. e.g. I have tried to add ajax support the following way:

<%= recaptcha_tags options: { ajax: true } %><%= recaptcha_tags ajax: true %><%= recaptcha_tags { ajax: true } %>

none of which are working, and some are not working. Are the ajax callbacks sufficient enough to work with the pjax callbacks? Is there a workaround, except needing to implement the recaptcha api plain from google?

— Reply to this email directly or view it on GitHub https://github.com/ambethia/recaptcha/issues/151.

lustremedia commented 8 years ago

@grosser can you elaborate or show some sample code? Would be highly appreciated!

grosser commented 8 years ago

something like tags_helper ajax: true and then add ajax to the options here If that does not work, see what custom html works and make the changes in the helper to generate it.