Looking for assistance in a authorized to edit method

36 Views Asked by At
  def authorized_to_edit?(review_info)
    set_review_info
    if  @user.id != @review_info.user.id
      redirect "/users/#{@user.id}"
    else
      redirect 'review_entries/user_review'
    end
  end 

I am trying to allow users that own the review_info can edit it and users who do not can view all review_info. Only the owner of the object can ever edit the object.

I am thinking of something like

if @user.id != @review_info.user.id

0

There are 0 best solutions below