title: Extending model to include "helper" methods
body: <p>I have a kind of social network website.</p>
  
  <p>I have a logic to create the path for the user, and select an avatar for each user described in UsersHelper methods user_path(user) and user_avatar(user).</p>
  
  <p>Instead I want to have methods like user.path and user.avatar, but I don't want to have that code inside the model file.</p>
  
  <p>I tried extending the User class inside the helper:</p>
  
  <pre><code>module UsersHelper
    class User
      def avatar
        ...
      end
    end
  end
  </code></pre>
  
  <p>That doesn't work - the method I added aren't recognized (I'm guessing Rails dynamically generates the ActiveRecord class on demand so my methods don't apply?)</p>
  
  <p>I'd really appreciate ideas</p>