Turns out that I was able to do this:
m=my_val.to_i
search_form.field_with(:name => "q").value = m
On Tue, Sep 1, 2009 at 7:37 PM, Dejan Tolj<dejan1 at gmail.com>
wrote:> Hi,
>
> I have an issue with mechanize when I try to set a value of a textbox
> with a variable.
> I have tried the following and none of them works:
>
> my_val=5
> ...
> search_form.field_with(:name => "q").value = my_val
> search_form.field_with(:name => "q").value = my_val.to_s
> search_form.field_with(:name => "q").value =
"#{my_val}"
>