Sha256: f877bcf46ab686086c75d7bcedb69d9347a610146cafc4901fd9eeda5379068c

Contents?: true

Size: 1009 Bytes

Versions: 11

Compression:

Stored size: 1009 Bytes

Contents

# Copyright (c) 2008-2013 Michael Dvorkin and contributors.
#
# Fat Free CRM is freely distributable under the terms of MIT license.
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php
#------------------------------------------------------------------------------
class Admin::ApplicationController < ApplicationController
  before_filter :require_admin_user

  layout "admin/application"
  helper "admin/field_groups"

  # Autocomplete handler for all admin controllers.
  #----------------------------------------------------------------------------
  def auto_complete
    @query = params[:auto_complete_query]
    @auto_complete = klass.text_search(@query).limit(10)
    render :partial => 'auto_complete'
  end

private

  #----------------------------------------------------------------------------
  def require_admin_user
    require_user
    if current_user && !current_user.admin?
      flash[:notice] = t(:msg_require_admin)
      redirect_to root_path
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.5 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.4 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.3 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.2 app/controllers/admin/application_controller.rb
fat_free_crm-0.12.3 app/controllers/admin/application_controller.rb
fat_free_crm-0.12.2 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.1 app/controllers/admin/application_controller.rb
fat_free_crm-0.12.1 app/controllers/admin/application_controller.rb
fat_free_crm-0.13.0 app/controllers/admin/application_controller.rb
fat_free_crm-0.12.0 app/controllers/admin/application_controller.rb