add co-author db and curd page, but it can't destory it...

This commit is contained in:
Rueshyna authored and chris committed 2012-11-21 18:36:32 +08:00
1 parent 6a9426c9c8
commit d502f561ef
7 files changed
+160

No files matched your search

@@ -0,0 +1,44 @@
<% if @co_author.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@co_author.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @co_author.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="fn_g hp">
<%= button_tag "Save", name: "commit", value: "Save", class: "fn_btn hh2 thmc2 thmtxt" %>
<%= button_tag "Cancel", name: "commit", value: "Cancel", class: "fn_btn hh2 thmc2 thmtxt" %>
</div>
<div></div>
<ul>
<li class="s_grid_row">
<%= f.label :co_author %><br />
<%= f.text_field :co_author %>
</li>
<li class="s_grid_row">
<%= f.label :email %><br />
<%= f.text_field :email %>
</li>
<li class="s_grid_row">
<%= f.label :type%><br />
<select name="co_author[type]" id="" class="s_grid s_grid_4">
<%= options_for_select(
[["朋友","朋友"],
["學生","摯友"],
["老師","老師"],
["摯友","摯友"],
["親戚","親戚"],
["同事","同事"],
["共同作者","共同作者"]
])
%>
</select>
</li>
</ul>
@@ -0,0 +1,3 @@
<%= form_for @co_author, url: desktop_co_author_path(@co_author) do |f| %>
<%= render partial: 'desktop/co_authors/form', locals: {:f => f} %>
<% end %>
@@ -0,0 +1,20 @@
<table>
<tr>
<th>Name</th>
<th>EMail</th>
<th>Type</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @co_authors.each do |co_author| %>
<tr>
<td><%= co_author.co_author %></td>
<td><%= co_author.email %></td>
<td><%= co_author.type%></td>
<td><%= link_to 'Destroy', desktop_co_author_path(co_author), method: :delete, confirm: 'Are you sure?' %></td>
</tr>
<% end %>
</table>
<br />
@@ -0,0 +1,3 @@
<%= form_for @co_author, url: desktop_co_authors_path do |f| %>
<%= render partial: 'desktop/co_authors/form', locals: {:f => f} %>
<% end %>
Whitespace-only changes.