Skip to content

Chap14#15

Open
ngango0205 wants to merge 2 commits intodevelopfrom
chap14
Open

Chap14#15
ngango0205 wants to merge 2 commits intodevelopfrom
chap14

Conversation

@ngango0205
Copy link
Owner

No description provided.

overflow: auto;
margin-top: 10px;
.gravatar {
margin: 1px 1px;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bỏ 1 cái 1px đi nhé


def logged_in_user
return if logged_in?
store_location

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent thẳng hàng dòng trên nhé, cả 3 dòng này luôn

redirect_to root_url
else
@feed_items = []
render "static_pages/home"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sao file này hình như của chap 13 mà em ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cái này lúc em sửa chap 13 ko rails s chạy lại nên thiếu end, sang chap 14 em mới sửa ạ ✌️

current_user.follow user
respond_to do |format|
format.html { redirect_to @user }
format.js

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cái này để làm gì thế em :v

@@ -0,0 +1,2 @@
module RelationshipsHelper

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bỏ file này

has_many :microposts, dependent: :destroy
has_many :active_relationships, class_name: "Relationship",
foreign_key: "follower_id",
dependent: :destroy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 space only

dependent: :destroy
has_many :passive_relationships, class_name: "Relationship",
foreign_key: "followed_id",
dependent: :destroy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 space only

format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }
format: { with: VALID_EMAIL_REGEX },
uniqueness: { case_sensitive: false }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xóa space thừa trong {} nhé

end

def feed
following_ids = "SELECT followed_id FROM relationships

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

có thể đổi sang query của active record ko em

@@ -0,0 +1,2 @@
$("#follow_form").html("<%= escape_javascript(render("users/unfollow")) %>");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em dùng như sau nhé: <%= j render "users/unfollow" %>, cả file bên dưới nữa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants