Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample_app
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Đường Sỹ Hoàng
sample_app
Commits
1cf7b5ac
Commit
1cf7b5ac
authored
Nov 22, 2019
by
Đường Sỹ Hoàng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed coding styles
parent
183850cf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
6 deletions
+8
-6
app/controllers/users_controller.rb
+2
-2
app/helpers/relationships_helper.rb
+0
-2
app/models/user.rb
+2
-2
app/views/users/edit.html.erb
+4
-0
No files found.
app/controllers/users_controller.rb
View file @
1cf7b5ac
...
...
@@ -54,14 +54,14 @@ class UsersController < ApplicationController
def
following
@title
=
"Following"
@user
=
User
.
find
(
params
[
:id
])
@user
=
User
.
find
(
params
[
:id
])
@users
=
@user
.
following
.
paginate
(
page:
params
[
:page
])
render
"show_follow"
end
def
followers
@title
=
"Followers"
@user
=
User
.
find
(
params
[
:id
])
@user
=
User
.
find
(
params
[
:id
])
@users
=
@user
.
followers
.
paginate
(
page:
params
[
:page
])
render
"show_follow"
end
...
...
app/helpers/relationships_helper.rb
deleted
100644 → 0
View file @
183850cf
module
RelationshipsHelper
end
app/models/user.rb
View file @
1cf7b5ac
...
...
@@ -90,7 +90,7 @@ class User < ApplicationRecord
# See "Following users" for the full implementation.
def
feed
following_ids
=
"SELECT followed_id FROM relationships
WHERE
follower_id = :user_id"
WHERE follower_id = :user_id"
Micropost
.
where
(
"user_id IN (
#{
following_ids
}
)
OR user_id = :user_id"
,
user_id:
id
)
end
...
...
@@ -119,7 +119,7 @@ class User < ApplicationRecord
# Creates and assigns the activation token and digest.
def
create_activation_digest
self
.
activation_token
=
User
.
new_token
self
.
activation_token
=
User
.
new_token
self
.
activation_digest
=
User
.
digest
(
activation_token
)
end
end
app/views/users/edit.html.erb
View file @
1cf7b5ac
...
...
@@ -6,12 +6,16 @@
<div
class=
"row"
>
<div
class=
"col-md-6 col-md-offset-3"
>
<
<<<<<<
HEAD
<<<<<<<
HEAD
<%=
render
"form"
%>
<
div
class=
"gravatar_edit"
>
<%=
gravatar_for
@user
%>
<a
href=
"http://gravatar.com/emails"
>
change
</a>
=======
<%=
render
"form"
%>
=======
<%=
render
"form"
%>
>>>>>>> Fixed coding styles
<div
class=
"gravatar_edit"
>
<%=
gravatar_for
@user
%>
<a
href=
"http://gravatar.com/emails"
>
change
</a>
...
...
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