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’) %>

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

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 P. 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!