1

新しいjquery-uiタブで編集アクションを開きたい

私のリンクは

<%= 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>
4

1 に答える 1

2
$('#container-1').tabs("add", 'newtab', 'Title');
$('#newtab').html(newtabhtml);
于 2013-01-03T08:41:24.157 に答える