Ruby on Rails: Can't implement Star Rating system
I'm trying to add a simple Star Rating system for my app having taken this tutorial for an example. I have User, Hotel and Rating models. Dependencies are: (rating.rb) belongs_to :user belongs_to :hotel (hotel.rb) & (user.rb) has_many :ratings And with the following code in hotel view I get this error: NameError in Hotels#show undefined local variable or method `user' for Class... (in the line with <%= form_for ...) Hotel view (show.html.erb): <% form_id = "hotel_#{@hotel.id}_rating" %> <% if signed_in? %> <!-- To avoid throwing an exception if no user is signed in --> <% user_id = current