Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Vanessa Silva
Tinder
Commits
db6ee624
Commit
db6ee624
authored
Sep 16, 2021
by
Vanessa Silva
Browse files
Methods Fixed
parent
1661899b
Pipeline
#41760
passed with stage
in 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
app/controllers/likes_controller.rb
app/controllers/likes_controller.rb
+6
-4
app/views/home/index.html.erb
app/views/home/index.html.erb
+3
-3
No files found.
app/controllers/likes_controller.rb
View file @
db6ee624
...
...
@@ -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
...
...
app/views/home/index.html.erb
View file @
db6ee624
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment