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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -