Home>

With Ruby on Rails, you can buy and sell with individuals like time tickets I want to create a service like this.
In this process, we would like to make specifications so that "if a user has already reviewed the user, you can edit it instead of posting a review" in order to implement the review function.

I'm getting an error when using the if statement on the screen to determine if the user has reviewed.
Rails tutorial Partial of follow/follower cancellation form Is not displayed well.

Error
undefined method `review_content? 'for #<User: 0x007fe1d210ac28>
Did you mean? Review_content
               review_content =
               review_content_ids
               reviewed_content
               reviewed_content =
View
<% if current_user.review_content? (@ user)%>
<div>
  <% = link_to @ user.username + "Edit reviews", edit_review_path%>
</div>
<% elsif @user! = current_user%>
<div>
  <% = link_to @ user.username + "Write a review", new_review_path%>
</div>
<% end%>
Controller
class UsersController<ApplicationController
  def show
    @user = User.find (params [: id])
    @reviews = @ user.passive_reviews
  end
end
Model
  

User model

class User<ApplicationRecord
...
  has_many: review_content, through:: active_reviews, source:: reviewed
  has_many: reviewed_content, through:: passive_reviews, source:: reviewer
end
  

Review model

class Review<ApplicationRecord
  belongs_to: reviewer, class_name: "User"
  belongs_to: reviewed, class_name: "User"
  validates: reviewer_id, presence: true
  validates: reviewed_id, presence: true
end