-
Notifications
You must be signed in to change notification settings - Fork 444
Data attributes
xanadiu edited this page Apr 23, 2017
·
5 revisions
By looking at the files in the gem you will see that you can easily add some attributes to the recaptcha. Perhaps you want to have a data-callback to trigger some javascript when the checkbox is clicked?
- badge
- theme
- type
- callback
- expired_callback
- size
- sitekey
- id
Simply add them as optional parameters to the recaptcha:
<%= recaptcha_tags(callback: 'recaptcha_callback', id: 'boogie', sitekey: 'blahblahblahblah' ) %>
This produces a recaptcha like this:
<div class="g-recaptcha" data-callback="recaptcha_callback" data-sitekey="blahblahblahblah" id="boogie">