title: Rails user rating, can only rate myself
body: <p>I am trying to set up a 5 star rating system so users can rate other users. At the moment everything is working, (create, delete, update etc...) but only the logged in user can rate himself. I cannot rate other users. I get no errors, it just redirects to the user profile page as it should but without added a rating to that user.</p>
  
  <p>user.rb </p>
  
  <pre><code>class User &lt; ActiveRecord::Base
  has_many :reviews
  </code></pre>
  
  <p>review.rb</p>
  
  <pre><code>class Review &lt; ActiveRecord::Base
    belongs_to :user
  end
  </code></pre>
  
  <p>reviews_controller.rb</p>
  
  <pre><code>class ReviewsController &lt; ApplicationController
  
   before_action :find_user
   before_action :find_review, only: [:edit, :update, :destroy]
  
   def new
     @review = Review.new
   end
  
   def create
     @review = Review.new(review_params)
     @review.user_id = current_user.id
     if @review.save
       redirect_to user_path(@user)
     else
       render 'new'
     end
   end
  
   def edit
   end
  
   def update
     if @review.update(review_params)
       redirect_to user_path(@user)
     else
       render 'edit'
     end
   end
  
   def destroy
     @review.destroy
     redirect_to user_path(@user)
   end
  
   private
  
   def review_params
     params.require(:review).permit(:rating, :comment)
   end
  
   def find_user
     @user = User.find(params[:user_id])
   end
  
   def find_review
     @review = Review.find(params[:id])
   end
  
  end
  </code></pre>
  
  <p>_form which then gets rendered on show page:</p>
  
  <pre><code>&lt;%= simple_form_for([@user, @user.reviews.build]) do |f| %&gt;
    &lt;div id="rating-form"&gt;
      &lt;label&gt;Rating&lt;/label&gt;
    &lt;/div&gt;
    &lt;%= f.input :comment %&gt;
    &lt;%= f.button :submit %&gt;
  
  &lt;% end %&gt;
  
  &lt;script&gt;
    $('#rating-form').raty({
      path: '/assets/',
      scoreName: 'review[rating]'
    });
  &lt;/script&gt;
  </code></pre>
  
  <p>Any help getting this to work would be greatly appreciated!!</p>