Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
blog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mis-21-2018-intersession
rails
blog
Commits
041d3258
Commit
041d3258
authored
Jul 02, 2018
by
John Noel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Post show page and function
parent
3ebbf0aa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
posts_controller.rb
app/controllers/posts_controller.rb
+1
-0
index.html.erb
app/views/posts/index.html.erb
+3
-0
show.html.erb
app/views/posts/show.html.erb
+10
-2
No files found.
app/controllers/posts_controller.rb
View file @
041d3258
...
...
@@ -4,6 +4,7 @@ class PostsController < ApplicationController
end
def
show
@post
=
Post
.
find_by
(
id:
params
[
:id
])
end
def
new
...
...
app/views/posts/index.html.erb
View file @
041d3258
...
...
@@ -26,6 +26,9 @@
<td>
<%=
post
.
content
%>
</td>
<td>
<%=
link_to
"Show"
,
post_path
(
post
),
class:
"btn btn-primary"
%>
</td>
</tr>
<%
end
%>
</tbody>
...
...
app/views/posts/show.html.erb
View file @
041d3258
<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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment