# Default text\_field size

**URL:** <https://www.ruby-forum.com/t/default-text-field-size/171594>\
**Category:** Rails\
**Created:** [July 6, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/default-text-field-size/171594 "2009-07-06T13:08:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Kahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@James\_Kahn](https://www.ruby-forum.com/u/James_Kahn)\
**Post date:** [July 6, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/default-text-field-size/171594/1 "2009-07-06T13:08:50Z")

</div>

Hi all,

The default field size in a view is 30, which is too large for most of  
the  
fields in my application. Is there a way to set the default text\_field  
size  
to something smaller without changing each field individually?

Thanks,  
James.

---

<div class="post-metadata">

**Author:** ![James\_Kahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@James\_Kahn](https://www.ruby-forum.com/u/James_Kahn)\
**Post date:** [July 6, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/default-text-field-size/171594/2 "2009-07-06T19:23:58Z")

</div>

if you patch it like this, it’ll change the default size to 20

module ActionView  
module Helpers  
class InstanceTag  
DEFAULT\_FIELD\_OPTIONS = { “size” =\> 20 }.freeze  
end  
end  
end

Cheers!

> **[arzumy md - short notes on small discoveries](http://ar.zu.my)**
>
> Arzumy is prolific CTO with over 12 years of experience. He has led engineering teams in a wide range of industries from 020, Fitness, Fintech, and e-Commerce to Digital Media and Mobile Communication.

---

<div class="post-metadata">

**Author:** ![James\_Kahn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/35a633/32.png) [@James\_Kahn](https://www.ruby-forum.com/u/James_Kahn)\
**Post date:** [July 7, 2009, 1:50am UTC](https://www.ruby-forum.com/t/default-text-field-size/171594/3 "2009-07-07T01:50:53Z")

</div>

Thanks Arzumy. Patching my local copy of rails is a bit much for me  
at the moment. However, I did find another alternative in using a  
helper method, which I think I will do. Thanks!
