Rails: how set ID or Name attribut in text_field_tag? -


<%= text_field_tag :barcode, params[:barcode] %> 

it generate

<input id="barcode" name="barcode" type="text"></input> 

but need

<input type="text" name="barcode" id="autocomplete"></input> 

but in documentation did not find way how change id attribute.

i need use text_field_tag because fills textbox params if submit fail.

if think im worry if change id not fill param ?!

try this

<%= text_field_tag :barcode, params[:barcode], id: 'autocomplete' %> 

Comments

Popular posts from this blog

c# - Attribute value in root node of xml Linq to XML -

android - Retrieve value from radioButtons in alertDialog -

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -