Commit 041d3258 authored by John Noel's avatar John Noel

Added Post show page and function

parent 3ebbf0aa
......@@ -4,6 +4,7 @@ class PostsController < ApplicationController
end
def show
@post = Post.find_by(id: params[:id])
end
def new
......
......@@ -26,6 +26,9 @@
<td>
<%= post.content %>
</td>
<td>
<%= link_to "Show", post_path(post), class: "btn btn-primary" %>
</td>
</tr>
<% end %>
</tbody>
......
<h1>Posts#show</h1>
<p>Find me in app/views/posts/show.html.erb</p>
<h1>Post #<%= @post.id %></h1>
<h2>
<%= @post.title %>
</h2>
<p>
<%= @post.content %>
</p>
<%= link_to "Back", posts_path, class: "btn btn-default" %>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment