Sha256: 920c4170cd599b4b946f19507b9cf26d113f89d3b24223665c3beebf6b2d5fec
Contents?: true
Size: 1008 Bytes
Versions: 15
Compression:
Stored size: 1008 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_action :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
15 entries across 15 versions & 2 rubygems