Class: Admin::Select2AjaxController

Inherits:
ApplicationController
  • Object
show all
Includes:
Effective::Select2AjaxController
Defined in:
app/controllers/admin/select2_ajax_controller.rb

Instance Method Summary collapse

Methods included from Effective::Select2AjaxController

#respond_with_select2_ajax

Instance Method Details

#usersObject



8
9
10
11
12
13
14
# File 'app/controllers/admin/select2_ajax_controller.rb', line 8

def users
  collection = current_user.class.all

  respond_with_select2_ajax(collection) do |user|
    { id: user.to_param, text: user.try(:to_select2) || to_select2(user) }
  end
end