Posted on September 26, 2006 at 4:43 pm

Yesterday, somebody asked me if it’s possible to format the contents of an input field using the text_field form helper.

I don’t think its documented in the API docs, but you can specify the value to use by passing in a value parameter:

text_field :book, :title, :value => @book.title.upcase
One Comment:
Posted on October 26, 2006 at 8:29 am by AnĂ­bal Rojas

Great tip, just what I was looking for. Off Topic: I would recommend you to register your blog at RubyConer.com, a meeting place for people interested in the Ruby Programming Language or any of the related technologies.

Leave a comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>