to know how to implement authentication from scratch in Rails with the help of the has_secure_password class method and the bcrypt gem (while understanding what they do under the hood)
to design a more complex schema for a web app and be more familiar with ActiveRecord API such as custom foreign keys for belongs_to/has_many, using has_many :through and building more advanced queries by chaining where, order, and merge
to build more complex forms in views that involve multiple models.
Quick review:
Nice work with routes configuration.
Good logic with not allow add friend/sent messages to yourself.
Nice when checking any friends before allow to send messages.
Good work with models' relationship definition.
Good use of scope.
Good use with helper_method, before_action.
Issues:
Can't login.
Suggestions
You should validate password presence, in case of Facebook login, you can generate a password for it. Ideally, send that password to the user's email.
Remember to publish your Facebook App. Right now I can't login with Facebook.
Should validate email validity on your sign up form.
We can define multiple helper methods in the same line, g.e. helper_method :current_user, :get_path.
Congrats again on the submission. Keep your good work :100: Let us know if you have any feedback.
Hi @suns3t, nice work with the homework :+1:
The goals of this homework are:
has_secure_password
class method and thebcrypt
gem (while understanding what they do under the hood)belongs_to
/has_many
, usinghas_many :through
and building more advanced queries by chainingwhere
,order
, andmerge
Quick review:
scope
.helper_method
,before_action
.Issues:
Suggestions
email
validity on your sign up form.helper_method :current_user, :get_path
.Congrats again on the submission. Keep your good work :100: Let us know if you have any feedback.