Commit 1cf7b5ac by Đường Sỹ Hoàng

Fixed coding styles

parent 183850cf
...@@ -54,14 +54,14 @@ class UsersController < ApplicationController ...@@ -54,14 +54,14 @@ class UsersController < ApplicationController
def following def following
@title = "Following" @title = "Following"
@user = User.find(params[:id]) @user = User.find(params[:id])
@users = @user.following.paginate(page: params[:page]) @users = @user.following.paginate(page: params[:page])
render "show_follow" render "show_follow"
end end
def followers def followers
@title = "Followers" @title = "Followers"
@user = User.find(params[:id]) @user = User.find(params[:id])
@users = @user.followers.paginate(page: params[:page]) @users = @user.followers.paginate(page: params[:page])
render "show_follow" render "show_follow"
end end
......
module RelationshipsHelper
end
...@@ -90,7 +90,7 @@ class User < ApplicationRecord ...@@ -90,7 +90,7 @@ class User < ApplicationRecord
# See "Following users" for the full implementation. # See "Following users" for the full implementation.
def feed def feed
following_ids = "SELECT followed_id FROM relationships following_ids = "SELECT followed_id FROM relationships
WHERE follower_id = :user_id" WHERE follower_id = :user_id"
Micropost.where("user_id IN (#{following_ids}) Micropost.where("user_id IN (#{following_ids})
OR user_id = :user_id", user_id: id) OR user_id = :user_id", user_id: id)
end end
...@@ -119,7 +119,7 @@ class User < ApplicationRecord ...@@ -119,7 +119,7 @@ class User < ApplicationRecord
# Creates and assigns the activation token and digest. # Creates and assigns the activation token and digest.
def create_activation_digest def create_activation_digest
self.activation_token = User.new_token self.activation_token = User.new_token
self.activation_digest = User.digest(activation_token) self.activation_digest = User.digest(activation_token)
end end
end end
...@@ -6,12 +6,16 @@ ...@@ -6,12 +6,16 @@
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3"> <div class="col-md-6 col-md-offset-3">
<<<<<<< HEAD <<<<<<< HEAD
<<<<<<< HEAD
<%= render "form" %> <%= render "form" %>
<div class="gravatar_edit"> <div class="gravatar_edit">
<%= gravatar_for @user %> <%= gravatar_for @user %>
<a href="http://gravatar.com/emails">change</a> <a href="http://gravatar.com/emails">change</a>
======= =======
<%= render "form" %> <%= render "form" %>
=======
<%= render "form" %>
>>>>>>> Fixed coding styles
<div class="gravatar_edit"> <div class="gravatar_edit">
<%= gravatar_for @user %> <%= gravatar_for @user %>
<a href="http://gravatar.com/emails">change</a> <a href="http://gravatar.com/emails">change</a>
......
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