views:

24

answers:

2

there is

page.replace_html "id", thing to replace it with

but is there something where I can just insert a value into a text field?

A: 

I think you'll need to drop out of RJS and into Prototype for this one. For example, if your textfield id has a value "foo" then something like this might work:

page << %{
  var input = $('foo');

  input.writeAttribute('value', 'thing to replace it with');
}

updates the value attribute of the input element.

bjg
A: 

The way I found was to do this:

page[:object_column_name].value = whatever

its just the id of the field

DerNalia
OK, that seems like the simplest way to go
bjg