xaunlopez
xaunlopez

Reputation: 398

setting dynamic 'value' to <textarea> with ruby/sinatra/activerecords

I need some help with a simple blog I'm making using Ruby, Sinatra, and ActiveRecords.

I am trying to set a dynamic default 'value' to a input form, to allow users to edit their blog post without having to retype the whole thing.

This is what I have got so far:

<textarea type="comment" id="description" name="description" value="<%= @blog.description %>"></textarea>

If I change <textarea> to <input> it works.

Upvotes: 0

Views: 732

Answers (1)

Chris Peters
Chris Peters

Reputation: 18090

<textarea> does not have a value attribute.

You should change it to read like this:

<textarea type="comment" id="description" name="description"><%= @blog.description %></textarea>

Upvotes: 1

Related Questions