title: added gem and got this error undefined method `acts_as_votable' for #<Class:0x00007f65df881b38>
body: <p>baby Ruby coder here.</p>
  
  <p>I followed the steps here:<a href="https://masteruby.github.io/weekly-rails/2014/08/05/how-to-add-voting-to-rails-app.html#.XMFebOhKg2w" rel="nofollow noreferrer">https://masteruby.github.io/weekly-rails/2014/08/05/how-to-add-voting-to-rails-app.html#.XMFebOhKg2w</a> to upload this act_as_votable gem however when I refresh my site to see if it works I get the following error: <code>undefined method `acts_as_votable' for #&lt;Class:0x00007f65df881b38&gt;
  </code>
  The code does not seem to like the fact that I have put <code>act_as_votable</code> in my model I would like to use it on. </p>
  
  <p>The error in my console also indicates that something is wrong in my controller. Do I need to define something there too?</p>
  
  <p>Thanks in advance, </p>
  
  <p>Angela </p>
  
  <p>Model I want to use the act_as_votable gem on, you can see i have added it as the instructions instructed:</p>
  
  <pre><code>class Hairstyle &lt; ApplicationRecord
       belongs_to :user, optional: true
       has_many :comments, dependent: :destroy
       validates :name, presence: true
       validates :description, presence: true
       validates :category, presence: true
       acts_as_votable 
       mount_uploader :photo, PhotoUploader
     end
  </code></pre>
  
  <p>My hairstyles controller with the 'upvote' method at the end:</p>
  
  <pre><code>class HairstylesController &lt; ApplicationController
    def index
      if params[:category].present?    
        @hairstyles = Hairstyle.where(category: params[:category])
      elsif params[:search].present?
        @hairstyles = Hairstyle.where('name ILIKE ?', '%#{params[:search]}%')
      else
        @hairstyles = Hairstyle.all
      end
    end
  
    def show
      @hairstyle = Hairstyle.find(params[:id])
      @comment = Comment.new  
    end
  
    def new
      @hairstyle = Hairstyle.new
    end
  
    def create
      @hairstyle = Hairstyle.create(hairstyle_params)   
      @hairstyle.user = current_user
      if @hairstyle.save!
        redirect_to hairstyle_path(@hairstyle)
      else
        render 'new'
      end
    end
  
    def edit
      @hairstyle = Hairstyle.find(params[:id])
    end
  
    def update
      @hairstyle = Hairstyle.find(params[:id])
      @hairstyle.update(hairstyle_params)
      redirect_to hairstyles_path
    end
  
    def destroy
      @hairstyle = Hairstyle.find(params[:id])
      @hairstyle.destroy
      redirect_to hairstyles_path
    end
  
    def upvote
      @hairstyle = Hairstyle.find(params[:id])
      @hairstyle.upvote_by current_user
      redirect_to hairstyles_path
    end
  
    private
  
    def hairstyle_params
      params.require(:hairstyle).permit(:name, :description, :category, :location, :stylist, :photo, :video_url, :photo_cache)
    end
  end
  
  </code></pre>
  
  <p>My index file i'd like to display the gem on:</p>
  
  <pre><code>  &lt;% @hairstyles.each do |hairstyle| %&gt;
      &lt;%= link_to "upvote", like_hairstyle_path(hairstyle), method: :put%&gt;
    &lt;%end %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is my repo if needed :<a href="https://github.com/Angela-Inniss/hair-do" rel="nofollow noreferrer">https://github.com/Angela-Inniss/hair-do</a></p>