Showing 1 – 2 of 2 replies
hthought

typeahead is not a function problem (On Rails adaptation)

hthought PURCHASED
2 years ago
Hi !

I have been able to make typeahead work just fine on the nav search bar, but only when invoked from the forms main menu section. If i use it from another place I am getting this console error:

Uncaught TypeError: $(...).typeahead is not a function
at HTMLDocument.<anonymous> (index:967:22)
at j (jquery-3.1.1.min.source.js:2:1)
at k (jquery-3.1.1.min.source.js:2:1)

I am assuming that this is because a js file(typeahead.js?) is only included in the forms section of the demo and not other places, like the dashboard pages.

I am not entirely sure how to fix that though, do you have any idea ? :)

Awesome theme btw and greatly adapted for Rails, thanks!

Last edited 2 years ago

hthought
hthought PURCHASED
2 years ago
Oh, I got it actually, it's specified per controller. I added this line in the application controller and worked:

//= require typehead/bootstrap3-typeahead.min.js
WebAppLayers
WebAppLayers SELLER
2 years ago
Hi,

Yes, those third party libraries in Rails are load specified per controller.

Best, Damian