有
page.replace_html "id", thing to replace it with
但有什么地方我可以在文本字段中插入一个值吗?
答案 0 :(得分:0)
我认为你需要退出 RJS 并进入 Prototype 。例如,如果您的textfield
id的值为“foo”,则此类内容可能有效:
page << %{
var input = $('foo');
input.writeAttribute('value', 'thing to replace it with');
}
更新value
元素的input
属性。
答案 1 :(得分:0)
我找到的方法是这样做:
page[:object_column_name].value = whatever
它只是字段的id