Giter VIP home page Giter VIP logo

Comments (3)

markets avatar markets commented on July 24, 2024

Hi @dennis95stumm and thanks for trying invisible_captcha.

I'm not sure if I get 100% your proposal :), but if you want to use the scope for the honeypot attribute you can already use the following:

# view
<%= form_for(Topic.new) do |f| %>
  <%= f.invisible_captcha :subtitle %>
<% end %>
# controller
invisible_captcha only: [:create, :update], honeypot: 'subtitle'

You can see more controller and helper options here:

from invisible_captcha.

dsst95 avatar dsst95 commented on July 24, 2024

Hi @markets, thanks for the answer. But this isn't that what i want. I want to use the invisible captcha with a generated field name in a scope. The idea is that a the invisible captcha gets on every request a random field name and because all other fields are scoped it would be reasonable that the invisible captcha gets also scoped (like topic[randomName].
Finally i want to use it like this:

# view
<%= form_for(Topic.new) do |f| %>
  <%= f.invisible_captcha %>
<% end %>

or in my case i must specify it as follows:

# view
<%= form_for(Topic.new) do |f| %>
  <%= f.invisible_captcha nil %> 
<% end %>

since without a custom field name the scoping doesn't work for the invisible_captcha helper.

# controller
invisible_captcha only: [:create, :update], scope: 'topic'

from invisible_captcha.

markets avatar markets commented on July 24, 2024

ok, got it, you'd like to use the default random honeypots, with the scope option too. Yes, this is a feature request 😺

NOTE In the meantime, you can use the helper, instead of the form helper to avoid passing the nil value and use the random generated ones:

<%= form_for(Topic.new) do |f| %>
  <%= invisible_captcha %> 
<% end %>

from invisible_captcha.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.