简体   繁体   中英

How to specify a value for a textarea using formtastic?

Trying to give a textarea some default text using the formtastic rails helper. I can't use value like on other inputs, so how can I make this happen?

I think this might be a limitation or missing feature in Formtastic. For inputs like :string you can do :input_html => { :value => 'whatever' } , but the "value" of a textarea isn't set with a HTML attribute.

Give that a try (we pass the :input_html options down to built-in Rails helpers, and maybe they'll do the right thing), otherwise, please submit an issue or a pull request on Github.

尝试:placeholder => placeholder_text

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM