How can I get a text area in a Rails form to pre-populate with the attribute of a model?
For instance, with the following:
= form_for @posts do |f|
.field
= f.label :company_name
= f.text_field :company_name
How could I get company_name to pre-populate with user.company_name?
You’ll need the form_for @user so it could access the user model’s attribute company_name.