Sha256: 3ac800b2f3fbe1b66874dedd5c3241bd0cced236b0919bb7811761d8176b9420

Contents?: true

Size: 209 Bytes

Versions: 13

Compression:

Stored size: 209 Bytes

Contents

module Admin
  module Autocomplete

    def autocomplete
      get_objects
      @items = @resource.limit(20)
      render :json => @items.map { |i| { "id" => i.id, "name" => i.to_label } }
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
brainsome_typus-4.0.0.beta13 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta12 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta11 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta10 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta9 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta8 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta7 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta6 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta5 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta4 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta3 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta2 app/controllers/concerns/admin/autocomplete.rb
brainsome_typus-4.0.0.beta1 app/controllers/concerns/admin/autocomplete.rb