自定义rails4删除弹出框

时间:2015-04-28 08:58:44

标签: ruby-on-rails ruby-on-rails-4.1

请指导我如何自定义我希望自己设计的删除弹出框。我在我看来已经给出了这个:

<td class="text-center">
   <%= link_to delete, user_path(user.id), method: :delete, :remote => true, data: { confirm: 'Are you sure?', no_turbolink: true } %>
</td>

我的弹出式HTML代码是

<div class="container">
  <div class="grid">
          <p  class="margin_B0"><a href="#"class="place-right" ><img src="images/close_icon.png" width="13" height="13"></a></p>
          <div class="row margin_T5 margin_B0 bg-white">
            <div class="row">
              <p>Text goes here</p>
            </div>
            <div class="row text-center">
              <input type="button" value="CANCEL" class="button meduim text_upper buttons_orange">
              <input type="submit" value="SUBMIT" class="button meduim text_upper buttons_orange">
            </div>
          </div>
  </div>
</div>

请帮助我写出我自己的弹出框视图。

提前致谢。

1 个答案:

答案 0 :(得分:1)

<%= link_to delete, user_path(user.id), method: :delete, :remote => true, data: { popup: true, no_turbolink: true } %>

$('a[data-popup]').on('click', function(e) { 
    var myWindow = window.open("", "myWindow", "width=200, height=100");   // Opens a new window; 
    myWindow.document.write("<p>This is 'myWindow'</p>");   // Text in the new window

    e.preventDefault(); 
});

尝试这样的事情