Fixes Authenticity Token error and adds logic to only show the Add Friend button if the users are not already friends. Passes all test and visible on localhost.
The Follower methods of get_user_id and not_a_friend?(current_user_id) are used in combination to check if the users are already friends. Ideally, these would be one call to the database, instead of two. I choose to make them two in order to meet the project deadline, as making them into one query was significantly increasing the developer time to write the query. I added these methods as a topic for refactoring to the -refactor card-.
Fixes Authenticity Token error and adds logic to only show the Add Friend button if the users are not already friends. Passes all test and visible on localhost.
The Follower methods of
get_user_id
andnot_a_friend?(current_user_id)
are used in combination to check if the users are already friends. Ideally, these would be one call to the database, instead of two. I choose to make them two in order to meet the project deadline, as making them into one query was significantly increasing the developer time to write the query. I added these methods as a topic for refactoring to the -refactor card-.