select2 rails form sends nothing

此生再无相见时 提交于 2019-12-12 05:49:06

问题


I'm stacked. I'm using select2 and acts_as_taggable to tag my order model. Here is a code

<div class="field">
<%= f.label :tag_list, "TAGS" %><br>
<%= f.select :tag_list, options_for_select([['Human', 'Hs'], ['Mouse', 'Mm'], ['Yeast', 'Sc']]),{},:multiple => true, :class =>"category" %>
</div>

And also script:

<script>
$(document).ready(function() {$(".category").select2(); });
</script>

All works fine without connecting script ( with select2) but if with, it looks like working good but it sends empty strings and after submitting you didn't get any tags here. Can anyone help?

来源:https://stackoverflow.com/questions/31990026/select2-rails-form-sends-nothing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!