I'm trying to use this gem to create a honeypot field, but I'm not sure how to implement it. How does the form know which field to make the honeypot and where do I specify the label? Here is the code I've used for the field, however when I run the app the form appears to be visible:
= form_for(:invitation, :url => request_invite_path, :html => {:id => 'login_form', :honeypot => true}) do |form|
= form.text_field :email, :size => nil
= form.text_field :honeypot #This field was created to store the honeypot input
%button{:type => "submit"} Request Invite
This honeypot is being used on a registration form which only asks for email address and then there is the extra honeypot field which is hidden. I currently have an invitation service, so when people input their email, an invitation is created and I can accept or reject it. What I want to do is get rid of the invitation feature, but I figure I can use this invitation feature in conjunction with the honeypot field to stop bots from registering.
Is there a way for me to skip the models and still use the honeypot field to either accept or reject the invitation? I don't actually need to store the honeypot data, but I need to use it to decide whether or not the invitation should be accepted.
So it should work like this:
- User gets to landing page
- User sees registration form consisting of
- email address input box
- honeypot field which is hidden
- If a bot registers it will fill in the honeypot, so when the invitation is being created I can automatically accept the ones that don't fill out the honeypot and the ones that do will be rejected.
One more thing, how do I test the honeypot field to see if its working? I want to fill it out and see if my code is doing what its supposed to.