Sha256: 20b8339a79408131019065688fbecb00f8b9c647eb6de5a0c8b26139ec826287

Contents?: true

Size: 528 Bytes

Versions: 1

Compression:

Stored size: 528 Bytes

Contents

class TopicsController < ApplicationController
  invisible_captcha honeypot: :subtitle, only: :create
  invisible_captcha honeypot: :subtitle, only: :update, on_spam: :custom_callback

  def new
    @topic = Topic.new
  end

  def create
    @topic = Topic.new(params[:topic])

    if @topic.valid?
      redirect_to new_topic_path(context: params[:context]), notice: 'Topic valid!'
    else
      render action: 'new'
    end
  end

  def update
  end

  private

  def custom_callback
    redirect_to new_topic_path
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
invisible_captcha-0.8.0 spec/dummy/app/controllers/topics_controller.rb