Commit db6ee624 authored by Vanessa Silva's avatar Vanessa Silva
Browse files

Methods Fixed

parent 1661899b
Pipeline #41760 passed with stage
in 52 seconds
......@@ -16,14 +16,16 @@ class LikesController < ApplicationController
private
def got_liked_user
User.find_by(id: like_params[:liked_user_id])
end
def create_match
Match.create(user_one: @got_liked_user, user_two: current_user)
Match.create(user_one: got_liked_user, user_two: current_user)
end
def likes_mutually
@got_liked_user = User.find_by(id: like_params[:liked_user_id])
true if @got_liked_user.liked_users.include?(current_user)
true if got_liked_user.liked_users.include?(current_user)
end
def like_params
......
......@@ -4,10 +4,10 @@
<div class="page-division items-center">
<% if @match_users.empty? %>
<div>
<p>No matches yet!</p>
<h2>No matches yet!</h2>
</div>
<% else %>
<p>Matches</p>
<h2>Matches</h2>
<% @match_users.each do |user| %>
<div>
<% if user.profile_picture.attached? %>
......@@ -27,7 +27,7 @@
<% end %>
</div>
<div class="items-center">
<p>Swipe!</p>
<h2>Swipe!</h2>
<% if @possible_match.nil? %>
<div>
<h1>No more people to see, sorry!</h1>
......
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