title: How to use decorator in rails correctly?
body: <p>I'm newbie in using decorators and I need your help to understand how to use it right and what am I doing wrong.</p>
  
  <p><strong>book_decorator.rb</strong></p>
  
  <pre><code>class BookDecorator &lt; ApplicationDecorator
    delegate_all
  
    def in_users_list?(user)
      if user.books.exists?
        true
      end
    end
  end
  </code></pre>
  
  <p><strong>views/books/index.html.slim</strong></p>
  
  <pre><code>- if book.in_users_list?(current_user)
    - button_text = 'I've read this book'
  ... #depict some buttons and links
  </code></pre>
  
  <p><strong>books_controller.rb</strong></p>
  
  <pre><code>class BooksController &lt; ApplicationController
    expose(:book, attributes: :book_params, finder_parameter: :id)
    expose_decorated(:book, decorator: BookDecorator)
  ...
  </code></pre>
  
  <p>I've followed these tutorials (<a href="https://github.com/netguru/decent_decoration" rel="nofollow">https://github.com/netguru/decent_decoration</a> <a href="https://github.com/drapergem/draper#decorating-objects" rel="nofollow">https://github.com/drapergem/draper#decorating-objects</a>) and it seems to be fine, but when i'm on books index page, it says </p>
  
  <blockquote>
    <p>undefined method `in_users_list?' for Book:0x007f6f4a0a4a18</p>
  </blockquote>
  
  <p>I suppose that it still doesn't know that it should use method from decorator, but how to fix it? I can't understand what I've done wrong, please help to find and fix problem! 
  Thank you in advance! </p>