views:

194

answers:

2

I have an .erb file with form template that uses form_for helper to generate form, and some of their fields generated with text_field method. In resulting HTML I see size properties are added to every input generated with aforementioned method.

I want to control input sizes with CSS and that size property prevents me from doing it. Is there any way to tell text_field method that I don't want them?

I tried to pass :size => nil as option to that method, but that didn't help.

+2  A: 

You can use CSS or the :size option to control the size of input fields. I'm not sure if there is an option to remove the size attribute, I've always just ignored it and set the width of input fields with CSS.

danengle
A: 

This worked for me

<%= f.text_field :title, :size => nil %>
iHeartDucks