Answer the question
In order to leave comments, you need to log in
How to connect js to Ruby on Rails 6?
Outputs in the console:
my.js:8 Uncaught ReferenceError: Bloodhound is not defined
at Object.<anonymous> (my.js:8)
at Object../app/javascript/packs/my.js (my.js:136)
at __webpack_require__ (bootstrap:19)
at Object../app/javascript/packs/application.js (application.js:22)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
at bootstrap:83
Answer the question
In order to leave comments, you need to log in
You need to add Bloodhound to the settings of the wepback plugins
environment.plugins.set(
'Provide',
new webpack.ProvidePlugin({
...
Bloodhound: 'typeahead.js/dist/bloodhound.js' // полный путь к вашей библиотеке
})
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question