select2-rails

select2-rails + act_as_taggable_on rails 4 issue

此生再无相见时 提交于 2019-12-02 09:33:02
I installed select2-rails and act_as_taggable_on gem to my app. I setup the act_as_taggable_on and it works (I tested from the console). However, when I tried to create the view so that user can add new tag, it's not working. I want to make a tagging support like this: https://select2.github.io/examples.html#tokenizer . Here is my setup: apps/assets/application.js $(document).ready(function(){ $(".multiple-input").select2({ theme: "bootstrap"; tags: true; tokenSeparators: [','] }) }); apps/views/profiles/new.html.erb <%= form_for @profile, url: user_profile_path do |f| %> <%= f.text_field

Rails 5 ask_as_taggable with select2

半腔热情 提交于 2019-12-02 08:12:51
I cannot see the effect of select2 in rails 5 form whether it's a text_field or select. does anyone know why the tag_list is not being populated. I can see that the tag_list has values but as you see in the snap below, it shows "No results found". Does select2 work with Rails 5 as I've tried several options? form: Select all will display all values into the box <%= f.label :tags, "Tags (separated by commas)" %> <%= f.text_field :tag_list, value: f.object.tag_list.each { |e| e} %> <input type="checkbox" id="checkbox" >Select All I made the text field simple instead of select2 and was able to

select2-rails gem is not working on Rails4

与世无争的帅哥 提交于 2019-11-30 13:54:12
I have tried given documentation for the select2-rails gem , but my browser console still throws an error. Uncaught TypeError: $(...).select2 is not a function I am using rails 4.0.1 & select2-rails 3.5.9.3 My application.js //= require jquery //= require select2 //= require jquery.ui.accordion //= require jquery.ui.menu //= require jquery.ui.datepicker //= require common //= require posts //= require twitter/bootstrap //= require owl.carousel //= require turbolinks //= require vendor_js //= require_tree . $(document).ready(function() { $("select#team_select").select2(); }); application.css *=

Prevent select2 from flipping the dropdown upward

笑着哭i 提交于 2019-11-30 00:11:14
As per title, is there a way to force select2 to always create a dropdown instead of a drop-up? There also appears to be some javascript that is either causing the flip when you scroll above the dropdown, adding a new CSS class "select2-drop-above", or both. EDIT: I should've specified that I'm pulling the library in via select2-rails. I'm hoping there is a way around this that doesn't involve pulling the whole select2 lib in myself and editing the select2.js file directly. Modifying the plugin is not preferred as you mention. I had a similar issue and couldn't find an way to use select2

select2-rails gem is not working on Rails4

本小妞迷上赌 提交于 2019-11-29 19:53:25
问题 I have tried given documentation for the select2-rails gem, but my browser console still throws an error. Uncaught TypeError: $(...).select2 is not a function I am using rails 4.0.1 & select2-rails 3.5.9.3 My application.js //= require jquery //= require select2 //= require jquery.ui.accordion //= require jquery.ui.menu //= require jquery.ui.datepicker //= require common //= require posts //= require twitter/bootstrap //= require owl.carousel //= require turbolinks //= require vendor_js //=