2013-01-03 46 views
1

我想在新jQueryUI的选项卡中打开编辑动作打开新的标签jQueryUI的

我的链接是

<%= link_to 'Show', student %> 

我希望在新的jQueryUI的选项卡中打开此。

怎么办?

这是我的索引页

<html> 
<head> 
    <title>jQuery UI Accordion</title> 
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> 
    <script src="http://code.jquery.com/jquery-1.8.3.js"></script> 
    <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> 
    <script> 
    $(document).ready(function() { 
     var $tabs = $("#container-1").tabs(); 
    }); 
    </script> 
</head> 
<body> 

<div id="container-1"> 
    <ul> 
     <li><a href="#fragment-1">List</a></li> 
     <li><a href="#fragment-2">Knockout Test</a></li> 
     <li><%= link_to 'New Student', {:controller => "students", :action => "new"} %></li> 
    </ul> 

    <div id="fragment-1"> 
     <h1>Listing students</h1> 

     <table> 
      <tr> 
     <th><%=t :Name%></th> 
      <th></th> 
      <th></th> 
      <th></th> 
      </tr> 

     <% @students.each do |student| %> 
      <tr> 
      <td><%= student.name %></td> 
      <td><%= link_to 'Show', student %></td> 
      <td><%= link_to 'Edit', edit_student_path(student) %></td> 
      <td><%= link_to 'Destroy', student, :method => :delete, :data => { :confirm => 'Are you sure?' } %></td> 
      </tr> 
     <% end %> 
     </table> 
    </div> 

    <div id="fragment-2"> 
     <p>First name: <input data-bind="value: firstName" /></p> 
     <p>Last name: <input data-bind="value: lastName" /></p> 
     <p>Full name: <strong data-bind="text: fullName"></strong></p> 
    </div> 

</div> 

回答

2
$('#container-1').tabs("add", 'newtab', 'Title'); 
$('#newtab').html(newtabhtml); 
+0

你能解释一下我怎么在我的代码把这个。我是新的jquery – Okky

+0

我想从该显示页面打开数据作为新标签 – Okky