Skip to content
Advertisement

Rails5 : Select2 Gem not working

I am a Rails beginner and trying to use Select2 gem in Rails application and I see it not working as expected.It is shown as normal drop down only where i am expecting search option included in it. Can some one help me please.


HTML Code

JavaScript

Here is my application.js

JavaScript

Gem file has the related gem

JavaScript

Advertisement

Answer

I don’t know what this is the solution but I have worked this manually on my application after following those steps

On Gemfile

JavaScript

application.js

JavaScript

Just above this //= require_tree . line

application.js

JavaScript

application.css

JavaScript

HTML Code

JavaScript

and finally, see the below image which I implemented

enter image description here

If you try this solution make sure restart your server after finished steps.

Hope to help

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement