ruby on rails - setting the size of input fields -


i have rails form i'm trying change size of default fields using either :size or both :cols => "30", :rows => "10" in code below. however, form fields staying default size. there i'm doing wrong?

<%= d.text_field c, :class => 'random', :value => "#{c}", :size => "30", :id => 'correction_data_'"#{c.parameterize}"%> 

or way

<%= d.text_field @title, :class => 'random', :value => "#{@title}", :cols => "30", :rows => "10", :id => 'correction_data_'"#{@title.parameterize}"%> 

text_field doesn't consider rows , cols attributes, consider size attribute. text_area considers rows, cols , size attributes.

text_field:

<%= d.text_field c, :class => 'random', :value => "#{c}", :size => 30, :id => 'correction_data_'"#{c.parameterize}" %> 

text_area using rows , cols:

<%= d.text_area @title, :class => 'random', :value => "#{@title}", :cols => 30, :rows => 10, :id => 'correction_data_'"#{@title.parameterize}" %> 

text_area using size:

<%= d.text_area @title, :class => 'random', :value => "#{@title}", :size => "30x10", :id => 'correction_data_'"#{@title.parameterize}" %> 

Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -