Skip to content

Commit b83b383

Browse files
committed
Fix likes controller redirect
1 parent 580ed09 commit b83b383

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/controllers/likes_controller.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ def create
88

99
if @like.save
1010
flash[:success] = 'Like saved successfully'
11-
redirect_to user_post_path(@post.author, @post)
1211
else
1312
flash.now[:error] = 'Error: Like could not be saved'
14-
render :new, status: 422
1513
end
14+
redirect_to user_post_path(@post.author, @post)
1615
end
1716

1817
private

0 commit comments

Comments
 (0)