Reputation: 861
I'd like to change the size of text_field, but it doesn't work.
new.html.erb
<div class="row">
<%= form_for(@user) do |f| %>
<%= render 'fields', f: f %>
<%= f.submit "Create my account", class: "btn btn-large btn-primary" %>
<% end %>
</div>
_fields.html.erb
<%= f.label :name %>
<%= f.text_field :name, size: 10 %>
size: 10
doesn't work.
Upvotes: 2
Views: 2588
Reputation: 44370
This is worked example, you doing some wrong, i belive you have some css style that override you text field :
<%= f.text_field :user, size: 10 %>
If i delete class
from submit, place </br>
, set 0 width
in css, and now i see size
of the text_field
I hope you understand this.
Upvotes: 1
Reputation: 12320
Try this size
option was there
<%= f.text_field :name, :size=>"10" :maxlength=>"254" %>
Upvotes: 1