Sha256: a630ee5391df2c13ab46cd9e46ba63d22df8bcd92e7f72c2f8723667eb2fc519

Contents?: true

Size: 897 Bytes

Versions: 11

Compression:

Stored size: 897 Bytes

Contents

class WcoHosting::ApplicationController < ActionController::Base

  check_authorization

  def home
    authorize! :index, ::WcoHosting::Appliance
  end

  ##
  ## private
  ##
  private

  def current_ability
    @current_ability ||= ::Wco::Ability.new(current_user)
  end

  def current_profile
    @current_profile ||= Wco::Profile.find_by( email: current_user.email )
  end

  def current_leadset
    @current_leadset ||= current_profile.leadset
  end

  def flash_alert what
    flash[:alert] ||= []
    if String == what.class
      str = what
    else
      str = "Cannot create/update #{what.class.name}: #{what.errors.full_messages.join(', ')} ."
    end
    flash[:alert] << str
  end

  def flash_notice what
    flash[:notice] ||= []
    if String == what.class
      str = what
    else
      str = "Created/updated #{what.class.name} ."
    end
    flash[:notice] << str
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
wco_hosting-0.0.0.12 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.11 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.9 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.8 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.7 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.6 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.5 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.4 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.3 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.2 app/controllers/wco_hosting/application_controller.rb
wco_hosting-0.0.0.1 app/controllers/wco_hosting/application_controller.rb