title: How SimpleForm maxlength extension works
body: <p>I want to set  the maxlength html attribute of the inputs on my forms created with the help of the SimpleForm gem. I know I can do this by passing in the maxlength attribute manually when creating the form, e.g.:</p>
  
  <pre><code>&lt;%= f.input :username, input_html: { maxlength: 20 } %&gt;
  </code></pre>
  
  <p>But that isn’t want I want because according the comments in the SimpleForm config file you should enable the maxlength extension which adds automatically this html attribute to the input tag for string attributes when a max-length validation is given.</p>
  
  <pre><code>## Optional extensions
  # They are disabled unless you pass `f.input EXTENSION_NAME =&gt; :lookup`
  # to the input. If so, they will retrieve the values from the model
  # if any exists. If you want to enable the lookup for any of those
  # extensions by default, you can change `b.optional` to `b.use`.
  
  # Calculates maxlength from length validations for string inputs
  b.use :maxlength
  </code></pre>
  
  <p>Unfortunately none of the 2 mentioned possibilities works.  Did I misunderstand the use of maxlength extension completely? </p>