When linking restaurants to reviews i am getting an error. When i enter the review rating and comment. I am getting error when clicking on create review.

undefined method @review.restaurant_id = @restaurant.id undefined method `restaurant_id=' for #<Review:0x007fed19fcae00> Did you mean? restaurant= restaurant restore_id! restore_rating! restore_Restaurant_Id! Restaurant_Id= Restaurant_Id Restaurant_Id? Restaurant_Id_was Extracted source (around line #22): 20 21 22 23 24 25 @review = Review.new(review_params) @review.user_id = current_user.id @review.restaurant_id = @restaurant_id respond_to do |format| if @review.save

Posted about 2 years ago by Bhaskar Varma Buddaraju
Posted about 2 years ago by Alex Yang

It looks like you're having an issue while going through the Yelpdemo course. Please post course-specific troubleshooting issues in the Discussion section beneath the video, not in the Ask a Developer section.

The issue you're seeing is likely due to having missed a step in the video. The error message says that the restaurant_id method doesn't exist - this can happen if you didn't set up your database properly. Did you add a 'restaurant_id' column to your Reviews database? Check the video Transcript/Notes to make sure you've followed each step in the video.

1