Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
rails3-jquery-autocomplete in ActiveAdmin?
ActiveAdmin.setup do |config|
#...
config.register_javascript 'autocomplete-rails.js'
end
ActiveAdmin.register Flight do
#...
controller do
autocomplete :pilot, :name, :full => true
end
form do |f|
f.input :pilot_name, :as => :autocomplete, :url => autocomplete_pilot_name_flights_path
end
end
source 'http://rubygems.org'
gem 'rails3-jquery-autocomplete'
Cpr::Application.routes.draw do
#...
resources :flights do
get :autocomplete_pilot_name, :on => :collection
end
end
@jerryshen
Copy link

jerryshen commented Apr 7, 2013

I think the css was messed up for autocomplete

@erem-ifg
Copy link

erem-ifg commented Oct 13, 2013

If you're using the jquery-ui gem,
don't forget to add the jquery.ui.theme.css file to active_admin stylesheets:

In config/active_admin.rb:
config.register_stylesheet 'jquery.ui.theme.css'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment