Has anyone managed to set maximum field lenghts for text fields
How can i set the maximum length of a text field. Here is the code iam using
<%= text_field_tag(:create_text), :input_html => {:maxlength => 15, :size => 40} %>
but I cannot seem to set the max number of characters that can be typed into the field.
Here is how you can do it:
<%= text_field_tag 'create_text', nil, :maxlength => 15, :size => 40 %>
Source: http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-text_field_tag