Friday 15 March 2013

recaptcha - ambethia / recaptch doesn't work with Rails 4 (Ruby 2.1.2) -



recaptcha - ambethia / recaptch doesn't work with Rails 4 (Ruby 2.1.2) -

i've installed gem ambethia/recaptcha described in readme.md file. restarted server after setting configure , public keys.

my problem... captcha can't trough. here's i'm doing:

in gemfile: gem "recaptcha", :require => "recaptcha/rails"

in view:

...form stuff generally... <%= recaptcha_tags %> <%= f.submit %>

in controller:

def create @form = form.new(form_params) respond_to |format| if verify_recaptcha(:model => @form, :message => t(:wrong_captcha)) && @form.save format.html formmailer.application_email(@form).deliver flash[:success] = t(:form_success) format.html { redirect_to root_path } end else format.html { render 'new' } end end end

regardless of fact seems ok (as far tell reading instructions in gem readme file), can't submit form. continuously shows error message captcha code wrong.

and on top of all, after i've installed gem, awful flash message saying "html" showing in form page when submit it.

i have read bug reports in gem, nil such issue. please, help me.

best regards, sly

if using turbolinks, need do

<%= recaptcha_tags(ajax: true) %>

instead of just

<%= recaptcha_tags %>

ruby-on-rails-4 recaptcha

No comments:

Post a Comment