【发布时间】:2016-09-06 18:55:42
【问题描述】:
我在 14 毫秒 ArgumentError 内收到 Completed 500 Internal Server Error - 当我单击链接以显示我的模式时,参数太少。我不知道为什么:
我有一个指向 images#show 的链接。但是我想使用引导模式来显示图像而不重新加载页面。
这是我的链接,点击时应该显示模式。链接
- url = @entry.class.to_s.downcase.singularize
= link_to(send("#{url}_path", @entry), data: { remote:true, 'type' => @entry.class.to_s.downcase }) do
= yield
这个链接在我家#index.
这是我的图片 # 显示控制器:
def show
authorize! :view, @image
@can_destroy = can?('delete_asset', @image)
@can_edit = can?('edit_metadata', @image)
format.js
format.json
end
我的 _modal 视图模板是:
<div id="contact-modal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
...
Moussa Testing the Modals
<div class="modal-body">
Me testing again
</div>
<div class="modal-footer">
Moussa testing encore.
</div>
</div>
</div>
</div>
我在 ajax 的图像视图中添加了一个 show.js.erb:
$('<%= j render "modalview" %>').modal();
我应该修改链接吗?如何 ?我错过了什么?
【问题讨论】:
标签: ruby-on-rails ajax twitter-bootstrap bootstrap-modal