title: Rails: How to display certain characters and dismiss the rest?
body: <p>When I use  </p>
  
  <pre><code>&lt;%= current_user.name[0,20] %&gt; 
  </code></pre>
  
  <p>it only shows 20 character, as I want. </p>
  
  <p>However, I want to use this approach in another context. I have </p>
  
  <pre><code>&lt;%= @patient.human_attribute_value(:complaints).html_safe %&gt;
  </code></pre>
  
  <p>and I want to display only [0,20] characters of this, but I didn't manage. 
  I tried </p>
  
  <pre><code>&lt;%= @patient.human_attribute_value(:complaints[0,20]).html_safe %&gt;
  </code></pre>
  
  <p>but it gives me an error.</p>
  
  <p>Can you please help me?</p>