1
Ich bekomme ständig die reCaptcha FehlerRails ReCaptcha: Ungültige Site-Schlüssel reCAPTCHA
ERROR for site owner:
Invalid site key
ich auf localhost zu testen bin, damit ich verstehe, dass dies einige Probleme verursachen kann, aber ich bin mit Tasten zur Verfügung gestellt von Google speziell für Tests found here.
recaptcha.rb Config
Recaptcha.configure do |config|
config.public_key = '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI'
config.public_key = '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe'
end
Bewertungen Controller
def create
@review = Review.create(review_params)
@review.professor_id = @professor.id
@review.guest = :guest
respond_to do |format|
if verify_recaptcha(model: @review) && @review.save
format.html{ redirect_to @professor, notice: 'Review was successfully created.' }
format.json { render :show, status: :created, location: @review }
else
format.html { render :new, notice: 'Please fill out the captcha.'}
format.json { render json: @review.errors, status: :unprocessable_entity}
end
end
end
Forum
<%= raw recaptcha_tags %>
<div class="actions">
<%= f.submit %>
</div>
Ohh peinlich haha, danke. – tfantina