Add admin/pages scaffold and basic page render

This commit is contained in:
Wen-Tien Chang committed 2009-05-08 01:18:16 +08:00
1 parent 40831c1314
commit 66604d00f4
12 files changed
+277 -5

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
<h1>Editing pages</h1>
<% form_for @page, :url => admin_page_path(@page) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name, "Name" %>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :content, "Content" %>
<%= f.text_area :content %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Back', admin_pages_path %>
+18
View File
@@ -0,0 +1,18 @@
<h1>Listing pages</h1>
<table>
<tr>
</tr>
<% @pages.each do |page| %>
<tr>
<td><%= link_to page.name, admin_page_path(page) %></td>
<td><%= link_to 'Edit', edit_admin_page_path(page) %></td>
<td><%= link_to 'Destroy', admin_page_path(page), :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New pages', new_admin_page_path %>
+21
View File
@@ -0,0 +1,21 @@
<h1>New pages</h1>
<% form_for :page, :url => admin_pages_path do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :name, "Name" %>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :content, "Content" %>
<%= f.text_area :content %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', admin_pages_path %>