Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submissions
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mis21-intersession-2016
submissions
Commits
1440af8c
Commit
1440af8c
authored
Jul 16, 2016
by
Paulo Macasaet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blog 144999
parent
91bf72d9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
2 deletions
+10
-2
.DS_Store
.DS_Store
+0
-0
posts_controller.rb
144999/LAB3/bblog/app/controllers/posts_controller.rb
+3
-1
index.html.erb
144999/LAB3/bblog/app/views/admin/posts/index.html.erb
+3
-0
index.html.erb
144999/LAB3/bblog/app/views/posts/index.html.erb
+3
-0
show.html.erb
144999/LAB3/bblog/app/views/posts/show.html.erb
+1
-1
No files found.
.DS_Store
View file @
1440af8c
No preview for this file type
144999/LAB3/bblog/app/controllers/posts_controller.rb
View file @
1440af8c
class
PostsController
<
ApplicationController
class
PostsController
<
ApplicationController
before_filter
:authenticate_user!
,
:except
=>
[
:show
,
:index
]
before_action
:authenticate_user!
def
index
def
index
@posts
=
Post
.
all
@posts
=
Post
.
all
render
"posts/index.html.erb"
render
"posts/index.html.erb"
...
...
144999/LAB3/bblog/app/views/admin/posts/index.html.erb
View file @
1440af8c
<h1>
Admin Blog Posts
</h1>
<h1>
Admin Blog Posts
</h1>
Hello
<%=
current_user
.
email
%>
<%=
link_to
(
"New Post"
,
new_admin_post_path
)
%>
<%=
link_to
(
"New Post"
,
new_admin_post_path
)
%>
<table
width=
"100%"
>
<table
width=
"100%"
>
...
...
144999/LAB3/bblog/app/views/posts/index.html.erb
View file @
1440af8c
<h1>
Blog Posts
</h1>
<h1>
Blog Posts
</h1>
Hello
<%=
current_user
.
email
%>
<table
width=
"100%"
>
<table
width=
"100%"
>
<tr>
<tr>
<th>
Title
</th>
<th>
Title
</th>
...
...
144999/LAB3/bblog/app/views/posts/show.html.erb
View file @
1440af8c
<h1>
<%=
@post
.
title
%>
</h1>
<h1>
<%=
@post
.
title
%>
</h1>
<h3>
<%=
@post
.
published_at
%>
by
<%=
current_user
.
email
%>
</h3>
<h3>
<%=
@post
.
published_at
%>
</h3>
<p>
<p>
<%=
@post
.
content
%>
<%=
@post
.
content
%>
</p>
</p>
...
...
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