以下は、ブートストラップのモーダルのコードの一部です。何が起こっているのかを完全に把握しようとしていますrole-options-<%= user.id %>
が、href= タグと div id タグの両方で問題が発生しています。ここで何が起こっているのかわかりません。なんらかの方法でデータを渡しているように感じます。また、これを正しく検索する方法もわかりません。したがって、誰かが私または彼らが指し示すことができる場所についての洞察を持っている場合、それはこの1行を説明するでしょう.
divに直接リンクしてuser.idを渡していますか?
<a data-toggle="modal" href="#role-options-<%= user.id %>" class="btn btn-mini" type="button">Change role</a>
<%= render user %>
<div id="role-options-<%= user.id %>" class="modal" style="display: none;">
<%= simple_form_for user, :url => user_path(user), :html => {:method => :put, :class => 'form-horizontal' } do |f| %>
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h3>Change Role</h3>
</div>
<div class="modal-body">
<%= f.input :role_ids, :collection => Role.all, :as => :radio_buttons, :label_method => lambda {|t| t.name.titleize}, :label => false, :item_wrapper_class => 'inline', checked: user.role_ids.first %>
</div>
<div class="modal-footer">
<%= f.submit "Change Role", :class => "btn" %>
<a class="btn" data-dismiss="modal" href="#">Close</a>
</div>
<% end %>
</div>