Sha256: 98f50b843251044ccc5919f08d6bb34a015b30c3489a3c8f08821c841b119350
Contents?: true
Size: 709 Bytes
Versions: 4
Compression:
Stored size: 709 Bytes
Contents
module Spina class InquiriesController < Spina::ApplicationController before_filter :setup_negative_captcha, only: [:create] def create @inquiry = Inquiry.new(@captcha.values) if @inquiry.save @inquiry.spam! unless @captcha.valid? InquiryMailer.inquiry(@inquiry).deliver unless @inquiry.spam else flash[:notice] = @captcha.error if @captcha.error render :failed end end private def setup_negative_captcha @captcha = NegativeCaptcha.new( secret: Spina.config.NEGATIVE_CAPTCHA_SECRET, spinner: request.remote_ip, fields: [:email, :message, :name], params: params ) end end end
Version data entries
4 entries across 4 versions & 1 rubygems