Popup window for Ruby on rails

后端 未结 1 434
难免孤独
难免孤独 2021-01-24 02:28

I have javascript for Popup as POPUP.JS

In my view i want to use the popup

 <%= link_to \"Start\" , answer_exam_group_answers_path(@exam_group), :clas         


        
1条回答
  •  情歌与酒
    2021-01-24 02:56

    Rails 3 deprecated :popup so it's best to write the popup JS yourself now. For the link you could do:

    <%= link_to "Start" , answer_exam_group_answers_path(@exam_group), :class => "submit_button", :onclick => 'return openPopup(this);' %>

    Then in your JS you would have this:

    function openPopup(link)
    {
        link.hide();
        window.open(link.href,'exam_dialog','toolbar=no,location=no,menubar=no,scrollbars=yes,resizable=no');
        return false;
    }
    

    0 讨论(0)
提交回复
热议问题