Sha256: 7c096ea13b98d4a2a60d5faffdfdf4d1bdd2906520877b5acf7a1ce42139a28e

Contents?: true

Size: 954 Bytes

Versions: 1

Compression:

Stored size: 954 Bytes

Contents

class TermsOfServiceAgreementsController < ApplicationController
  before_filter :authenticate_user!
  respond_to(:html)

  add_breadcrumb 'Terms of Service', lambda {|controller| controller.request.path }

  layout 'curate_nd/1_column'
  def new
  end

  def create
    if user_just_agreed_to_tos?
      current_user.agree_to_terms_of_service!
      redirect_to new_classify_concern_path
    else
      flash.now[:notice] = "To proceed, you must agree to the Terms of Service."
      render 'new'
    end
  end
  def user_just_agreed_to_tos?
    params[:commit] == i_agree_text
  end
  protected :user_just_agreed_to_tos?

  I_AGREE_TEXT = "I Agree"
  I_DO_NOT_AGREE_TEXT = "I Do Not Agree"
  def i_agree_text
    I_AGREE_TEXT
  end
  helper_method :i_agree_text

  def i_do_not_agree_text
    I_DO_NOT_AGREE_TEXT
  end
  helper_method :i_do_not_agree_text

  private

  def show_action_bar?
    false
  end

  def show_site_search?
    false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
curate-0.1.3 app/controllers/terms_of_service_agreements_controller.rb