Awesomplete For Rails
This is small gem add to your Rails app Awesomplete autocomplete.
This is the working version.
# Developed and tested on:
Ruby 2.1.0
Rails ~> 4.0.0
Getting started
- Add to
Gemfileandbundle install.
gem 'awesomplete'
- Add to
app/assets/javascripts/application.js:
//=require awesomplete
- Add to
app/assets/stylesheets/application.css
*= require awesomplete
Restart server. That's it.
Usage
Now you can write inputs with awesomplete autocomplete!
Check it out.
in controller:
def index
@collection = ['One', 'Two', 'Three', 'Four'].join(',')
end
in views:
<%= text_field_tag :something, nil, class: 'awesomplete', data: { list: @collection } %>
Configure module
You can configurate this autocomplete by two ways:
- In
data-options in views:
#TODO
- In
javascriptsinitializer (e.g.app/assets/javascripts/some_script.js):
#TODO
TODO
Write update version task.
Write full helper method like
link_toorassets_pathsomething likeawesomplete.
Kiselenko Roman
This project rocks and uses MIT-LICENSE.