Sha256: f7cdce312216b5a0a85fbbfbd78dda69fb29835fb666c685af91988fa84d7082

Contents?: true

Size: 958 Bytes

Versions: 13

Compression:

Stored size: 958 Bytes

Contents

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

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

  with_themed_layout '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_site_actions?
    false
  end

  def show_site_search?
    false
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
curate-0.6.6 app/controllers/terms_of_service_agreements_controller.rb
curate-0.6.5 app/controllers/terms_of_service_agreements_controller.rb
curate-0.6.4 app/controllers/terms_of_service_agreements_controller.rb
curate-0.6.3 app/controllers/terms_of_service_agreements_controller.rb
curate-0.6.1 app/controllers/terms_of_service_agreements_controller.rb
curate-0.6.0 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.6 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.5 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.4 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.2 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.1 app/controllers/terms_of_service_agreements_controller.rb
curate-0.5.0 app/controllers/terms_of_service_agreements_controller.rb
curate-0.4.2 app/controllers/terms_of_service_agreements_controller.rb