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
Post a Comment