Initial Commit

This commit is contained in:
Jason Katz
2011-06-14 18:08:28 -07:00
commit 5a34ac406c
172 changed files with 18457 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
<% div_for comment do %>
<h3>Posted <%= comment.created_at.to_s(:long) %> by <%= comment.commenter %></h3>
<p>
<%= h(comment.body) %>
</p>
<% end %>

View File

@@ -0,0 +1,24 @@
<h1>Editing comment</h1>
<% form_for(@comment) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :post_id %><br />
<%= f.text_field :post_id %>
</p>
<p>
<%= f.label :commenter %><br />
<%= f.text_field :commenter %>
</p>
<p>
<%= f.label :body %><br />
<%= f.text_area :body %>
</p>
<p>
<%= f.submit 'Update' %>
</p>
<% end %>
<%= link_to 'Show', @comment %> |
<%= link_to 'Back', comments_path %>

View File

@@ -0,0 +1,24 @@
<h1>Listing comments</h1>
<table>
<tr>
<th>Post</th>
<th>Commenter</th>
<th>Body</th>
</tr>
<% @comments.each do |comment| %>
<tr>
<td><%=h comment.post_id %></td>
<td><%=h comment.commenter %></td>
<td><%=h comment.body %></td>
<td><%= link_to 'Show', comment %></td>
<td><%= link_to 'Edit', edit_comment_path(comment) %></td>
<td><%= link_to 'Destroy', comment, :confirm => 'Are you sure?', :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to 'New comment', new_comment_path %>

19
app/views/comments/new.html.erb Executable file
View File

@@ -0,0 +1,19 @@
<h1>New comment</h1>
<% form_for(@comment) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :post_id %><br />
<%= f.text_field :post_id %>
</p>
<p>
<%= f.label :body %><br />
<%= f.text_area :body %>
</p>
<p>
<%= f.submit 'Create' %>
</p>
<% end %>
<%= link_to 'Back', comments_path %>

View File

@@ -0,0 +1,18 @@
<p>
<b>Post:</b>
<%=h @comment.post_id %>
</p>
<p>
<b>Commenter:</b>
<%=h @comment.commenter %>
</p>
<p>
<b>Body:</b>
<%=h @comment.body %>
</p>
<%= link_to 'Edit', edit_comment_path(@comment) %> |
<%= link_to 'Back', comments_path %>