rails gem选择和邮箱新消息

时间:2014-05-27 17:12:27

标签: javascript jquery ruby-on-rails jquery-chosen mailboxer

我尝试使用邮箱为新邮件实现所选的gem。但是选择框始终显示为空。

讯息/ new.html.erb

<%= form_tag({controller: "messages", action: "create", 
:class => "form-horizontal"}, method:  :post) do %>     
    <h3>Reply</h3>
    <%= select :recipients,
       User.all.map { |u| [u.name, u.id] },
       { class: 'chosen-select' }
    %>
    <%= text_area_tag :body,nil, class: 'form-control'%>
    <%= submit_tag 'Send message', class: "btn btn-primary" %>
    <% end %>

Messages.js.coffee

$('#messages_recipients').chosen()

js错误:

[Error] ReferenceError: Can't find variable: jQuery (chosen.jquery.js, line 524)
[Error] ReferenceError: Can't find variable: $ (messages.js, line 2)

有人能看到问题吗?我猜测我只是遗漏了一些小东西,它已经很长时间了; /

0 个答案:

没有答案