Add announcement model
This commit is contained in:
1 parent
62602940ed
commit
4807066c68
12 files changed
+182
-278
No files matched your search
@@ -21,4 +21,9 @@
|
||||
<p>
|
||||
<%= f.label :external_link, "External Link" %>
|
||||
<%= f.text_field :external_link %>
|
||||
</p>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :use_engine, "Use Engine" %>
|
||||
<%= f.text_field :use_engine %>
|
||||
<p>
|
||||
@@ -0,0 +1,22 @@
|
||||
<h1>Editing announcement</h1>
|
||||
|
||||
<% form_for(@announcement) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :title, "Title" %>
|
||||
<%= f.text_field :title %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :content, "Content" %>
|
||||
<%= f.text_area :content %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Update' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Show', @announcement %> |
|
||||
<%= link_to 'Back', announcements_path %>
|
||||
@@ -0,0 +1,18 @@
|
||||
<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 %>
|
||||
@@ -0,0 +1,21 @@
|
||||
<h1>New announcement</h1>
|
||||
|
||||
<% form_for(@announcement) do |f| %>
|
||||
<%= f.error_messages %>
|
||||
|
||||
<p>
|
||||
<%= f.label :title, "Title" %>
|
||||
<%= f.text_field :title %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.label :content, "Content" %>
|
||||
<%= f.text_area :content %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<%= f.submit 'Create' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Back', announcements_path %>
|
||||
@@ -0,0 +1,3 @@
|
||||
|
||||
<%= link_to 'Edit', edit_announcement_path(@announcement) %> |
|
||||
<%= link_to 'Back', announcements_path %>
|
||||
Reference in new issue
Block a user