<%= text_field_tag :barcode, params[:barcode] %>
generates
<input id="barcode" name="barcode" type="text"></input>
but I need
<input type="text" name="barcode" id="autocomplete"></input>
But in the documentation I did not find a way how to change the ID attribute.
I need to use a text_field_tag because it fills the textbox with params if submit fails.
try this
<%= text_field_tag :barcode, params[:barcode], id: 'autocomplete' %>
You can also try this...
<%= text_field_tag :barcode, params[:barcode], :id => 'autocomplete' %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With