How can I change the length of a text_field in rails?

css, html, ruby-on-rails-3, textfield

Solution

Use CSS. The width of the field isn't related to its maximum characters.

input.body {
  width:95%;
}

Problem

So I have this text field ``` <%= f.text_field :body, placeholder: "Make an offer ", :maxlength=>"254" %> ``` right now it takes up 100% of the width of the box it is in. I want it to take up like 95%. So far I have tried (from other forum posts) adding `:columns => "50"` this didn't affect it. I tried putting on an html tag , `:html => { :id => "offer_form" }` and then putting in my css file ``` #offer_form { width:50%;} ``` this didn't work any other suggestions? edit: I realized that in my css file I have under /forms/ ``` input, textarea, select, .uneditable-input { border: 1px solid #bbb; width: 98%; padding: 10px; height: auto !important; margin-bottom: 15px; } ``` and when i change the width here it works. but it affects all of the forms in the entire app (obviously)(ie they are all 98%). Is there a way that I can id just this field so that I can edit its width independently.

Original source