-1

I have a .slim file for my sign up page, but when I am trying to add the recaptcha_tags to the file I'm getting an error recaptcha_tags not defined, can anyone provide a small sample code to integrate recaptchabtags in .slim file and also the controller

A sample code regarding the question

1 Answers1

0

I think you are missing gem, Add this line to Gemfile then run bundle install

gem "recaptcha", "~> 5.12"

then create initializer file with these content

Recaptcha.configure do |config|
  config.site_key  = Rails.application.credentials.dig(:google_recaptcha, :site_key)
  config.secret_key = Rails.application.credentials.dig(:google_recaptcha, :secret_key)

  # Uncomment the following line if you are using a proxy server:
  # config.proxy = 'http://myproxy.com.au:8080'

  # Uncomment the following lines if you are using the Enterprise API:
  # config.enterprise = true
  # config.enterprise_api_key = 'AIzvFyE3TU-g4K_Kozr9F1smEzZSGBVOfLKyupA'
  # config.enterprise_project_id = 'my-project'
end

Add this in your slim file

= recaptcha_tags(noscript: false)

This should work.

MUHAMMAD SOBAN
  • 403
  • 8
  • 20