How to use typeahead.js as a Bower component with Rails 4 -
i'm trying use typeahead.js in rails 4 app. use bower instead of using gem. have installed in vendor/assets/components
. have included line below in config/application.rb
.
config.assets.paths << rails.root.join('vendor', 'assets', 'components')
i have searched extensively cannot seem figure out should include in app/assets/javascripts/application.js
rails recognize this. directory typeahead.js
installed in vendor/assets/components
. have tried
//= require typeahead.js
as few other options it's not working. i'm relative newbie rails , still trying figure out how of things work under hood. appreciated.
i recommend instead use rails assets. getting started simple adding
source 'https://rails-assets.org' gem 'rails-assets-bootstrap' #example gem 'rails-assets-angular' #example gem 'rails-assets-leaflet' #example end
to gemfile, replacing examples bower assets need. prefix given bower asset "rails-assets-", , you're go.
be sure check out website if need getting started!
Comments
Post a Comment