我的rails应用程序中有以下奇怪的问题。我正在使用bootstrap模式在我的学生模型中编辑学生信息。
<td><%= link_to t('edit'), edit_student_path(student),
{remote: true, 'data-toggle' => "modal",
'data-target' => '#modal-window'} %>
</td>
div class="modal fade modal8" id="modal-window" tabindex="-1"
role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
</div>
</div>
</div>模式可以像上面写的那样工作,但是如果我将模式的data-target和id从' modal -window‘更改为其他任何值,它就不能工作。怎么一回事?
发布于 2015-03-28 18:23:11
锚中的data-target应该是css selector,而在模式div中,你应该有那个选择器。
您正在更改它们中的任何一个,所以它不起作用,
https://stackoverflow.com/questions/29315983
复制相似问题