我有一个表格,显示每个用户的帖子。它工作正常,只有在此之后我才能得到...
[#<User id: 1, email: "[email protected]", encrypted_password:...
所以最终结果是这样的:
[email protected]
[#<User id: 1, email: "[email protected]", encrypted_password:
我在我看来使用的代码是这样的:
<div class="collaboratorbox">
<%= form_for @wiki do |f| %>
<%= @users.each do |user| %>
<p><%= check_box_tag 'user_ids[]', user.id %>
<%= label_tag 'user_ids[]', user.email %> </p>
<% end %>
<%= f.submit "Save Collaborators" %>
</div>
<% end %>
关于如何摆脱[#.....]代码的任何想法?
改变这个
<%= @users.each do |user| %>
对此
<% @users.each do |user| %>
通过使用等号,您可以告诉导轨将其打印到屏幕上
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句