Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/63.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Rails和Desive:使用acts_as_textcaptcha添加垃圾邮件保护_Ruby On Rails_Ruby_Devise_Captcha - Fatal编程技术网

Ruby on rails Rails和Desive:使用acts_as_textcaptcha添加垃圾邮件保护

Ruby on rails Rails和Desive:使用acts_as_textcaptcha添加垃圾邮件保护,ruby-on-rails,ruby,devise,captcha,Ruby On Rails,Ruby,Devise,Captcha,我正在尝试使用向我的Desive注册表单添加垃圾邮件保护,但由于某些原因,它不会显示在我的表单中 基于。此处提供的My Rails 6博客应用程序可用于克隆: 谢谢 Gemfile models/user.rb class用户

我正在尝试使用向我的Desive注册表单添加垃圾邮件保护,但由于某些原因,它不会显示在我的表单中

基于。此处提供的My Rails 6博客应用程序可用于克隆:

谢谢

Gemfile models/user.rb
class用户
控制器/注册\u controller.rb
类注册控制器
config/routes.rb
Rails.application.routes.draw do
为:用户、控制器设计{注册:“注册”}
...
结束
app/views/design/registrations/new.html.erb
对不起,如果我错了,你能告诉我这个
gem'acts\u textcaptcha',“~>4.5'
在哪里吗?我在您提供的链接中找不到此链接:。如果有任何问题,请遵循该gem并发回。您可以引用同一页面来配置设备:。谢谢。

事实证明,我必须在
config/environments/development.rb
中将
config.cache\u store=:null\u store
设置为
config.cache\u store=:memory\u store
才能在开发模式下工作。

你在说什么?
gem 'acts_as_textcaptcha', '~> 4.5'
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
...
  <%= textcaptcha_fields(f) do %>
    <div class="field">
      <%= f.label :textcaptcha_answer, @user.textcaptcha_question %><br/>
      <%= f.text_field :textcaptcha_answer, :value => '' %>
    </div>
  <% end %>
...
<% end %>
development:
  questions:
    - question: 'Is ice hot or cold?'
      answers: 'cold'
    - question: 'what color is an orange?'
      answers: 'orange'
    - question: 'what is two plus 3?'
      answers: '5,five'
    - question: 'what is 5 times two?'
      answers: '10,ten'
    - question: 'How many colors in the list, green, brown, foot and blue?'
      answers: '3,three'
    - question: 'what is Georges name?'
      answers: 'george'
    - question: '11 minus 1?'
      answers: '10,ten'
    - question: 'is boiling water hot or cold?'
      answers: 'hot'
    - question: 'what color is my blue shirt today?'
      answers: 'blue'
    - question: 'what is 16 plus 4?'
      answers: '20,twenty'