Add announcement admin and view template
This commit is contained in:
1 parent
4807066c68
commit
5570a2dfbf
12 files changed
+145
-115
No files matched your search
@@ -1,6 +1,6 @@
|
||||
<h1>Editing announcement</h1>
|
||||
|
||||
<% form_for(@announcement) do |f| %>
|
||||
<% form_for @announcement, :url => admin_announcement_path(@announcement) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
@@ -19,4 +19,4 @@
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Show', @announcement %> |
|
||||
<%= link_to 'Back', announcements_path %>
|
||||
<%= link_to 'Back', admin_announcements_path %>
|
||||
@@ -0,0 +1,21 @@
|
||||
<h1>Listing announcements</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
|
||||
<% @announcements.each do |announcement| %>
|
||||
<tr>
|
||||
<td><%=h announcement.title %></td>
|
||||
<td><%= link_to 'Show', announcement_path(announcement) %> |
|
||||
<%= link_to 'Edit', edit_admin_announcement_path(announcement) %> |
|
||||
<%= link_to 'Destroy', admin_announcement_path(announcement), :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New announcement', new_admin_announcement_path %>
|
||||
@@ -1,6 +1,6 @@
|
||||
<h1>New announcement</h1>
|
||||
|
||||
<% form_for(@announcement) do |f| %>
|
||||
<% form_for @announcement, :url => admin_announcements_path do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
@@ -18,4 +18,4 @@
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', announcements_path %>
|
||||
<%= link_to 'Back', admin_announcements_path %>
|
||||
@@ -1,18 +0,0 @@
|
||||
<h1>Listing announcements</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
</tr>
|
||||
|
||||
<% @announcements.each do |announcement| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', announcement %></td>
|
||||
<td><%= link_to 'Edit', edit_announcement_path(announcement) %></td>
|
||||
<td><%= link_to 'Destroy', announcement, :confirm => 'Are you sure?', :method => :delete %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New announcement', new_announcement_path %>
|
||||
@@ -15,9 +15,11 @@
|
||||
<body>
|
||||
<div class="container">
|
||||
<div id ="nav" class="span-24">
|
||||
<%= link_to 'Home', root_path %> |
|
||||
<%= link_to 'Pages', admin_pages_path %> |
|
||||
<%= link_to 'Snippet', admin_snippets_path %> |
|
||||
<%= link_to 'Layout', admin_layouts_path %>
|
||||
<%= link_to 'Layout', admin_layouts_path %> |
|
||||
<%= link_to 'Announcement', admin_announcements_path %>
|
||||
</div>
|
||||
|
||||
<%= yield %>
|
||||
|
||||
Reference in new issue
Block a user