Rails 3.0.2 と ruby 2.0.0 をシンプルな captcha gem で使用しています。
Gemfile -
gem 'simple_captcha', :git => 'git://github.com/galetahub/simple-captcha.git'
意見 -
Verification code:<%= show_simple_captcha :label => "Please type the verification code", :image_style => "simply_green", :object => "foo" %>
しかし、キャプチャ画像が表示されません。
Railsコンソールでこのエラーが発生するたびに-
2014-05-05 23:38:41 +0530 で 127.0.0.1 の GET "/simple_captcha?code=d3423b2321c833f8974c50e34528603f111c0d40&time=1399313320" を開始しました
TypeError (nil を Integer に変換できません)
このブログもフォローしようとしましたが、うまくいきませんでした。
コントローラ:-
def contact
if request.post?
@contact = Contact.new(params[:contact])
if @contact.valid_with_captcha?
@contact.save_with_captcha
flash[:title] = "Thank you"
else
flash[:title] = "Sorry"
end
redirect_to contact_us_path
else
@contact = Contact.new
end
end
ありがとう