Rails:在Bootstrap模式中编辑记录

我正在尝试在Rails中使用Bootstrap模式来编辑记录,但我无法将模式范围扩展到当前记录

静态链接是

 "modal", :class => 'btn btn-mini', :id => 'edit_modal_link', "data-toggle" => "modal" %> 

我真的需要在id / edit上调用模式,这是票号,但是无法将其链接到表中的选定记录。

有任何想法吗?

或渲染部分,但必须使用可用的票证调用部分,它的范围是否正确到我们需要编辑的票证?

我的部分看起来像

  { :class => 'form-horizontal' } do |f|%> 
'control-label' %>
'text_field', :id =>"cust_id" %> '#cust_id', :class => 'text_field ui-autocomplete-input' %>

哪个需要在Modal中渲染,

另一种方法是这样的:

只需创建一个远程链接:

 link_to "edit", edit_ticket_path(ticket), class: "btn btn-mini", remote: true 

然后在您的视图中,添加edit.js.erb文件:

 $("#myModal").html("<%= j render "new"%>"); $('#myModal').modal('show'); 

并将您的edit.html和new.html文件更改为_new.html和edit.html