How to modify the html name attribute of a generated input?

How can I change the html name attribute of an input? I've tried the
approach used to change the name of a form object:

<%= text_field({'object', 'field'}, 'my_name') %></p>

But it only added to the name attribute instead of replacing it:

<input id="objectfield_namemy_name" name="objectfield[namemy_name]"
size="30" type="text" />

Any idea how I could replace the name attribute completely?

Use text_field_tag().

p.s. why do you want to break the convention?

Keynan Pratt wrote:

Use text_field_tag().

p.s. why do you want to break the convention?

I'm trying to test form automation with www::mechanize. From the syntax
I'm using (form.field = X), mechanize reads the rails name tags
incorrectly. In my above example, it reads name=objectfield[namemyname]
as name=objectfield and can't find that page element.

text_field_tag and select_tag work wonderfully for setting a name
attribute and testing this though. Thanks!