Search code examples
ruby-on-railsformtastic

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?


Solution

  • 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.