mirror of
https://github.com/iritmaximus/brewery.git
synced 2026-10-12 19:13:49 +03:00
only user that created rating can delete it
This commit is contained in:
@@ -22,7 +22,7 @@ class RatingsController < ApplicationController
|
||||
|
||||
def destroy
|
||||
rating = Rating.find params[:id]
|
||||
rating.delete
|
||||
redirect_to ratings_path
|
||||
rating.delete if current_user == rating.user
|
||||
redirect_to user_path current_user
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user