Text input

<% id = "TEXT#{Time.now.to_i}" %>

<%= text_field_tag :name, 'Test', data: { bind: id } %>

<%= content_tag :span, 'Test', bind: id, id: 'span_text_tag' %>

Select input

<% id_select = "SELECT#{Time.now.to_i}" %>

<%= select_tag :select, options_for_select([['First Option', :first_option], ['Second Option', :second_option]]), id: 'select_input', data: { bind: id_select } %>

<%= content_tag :span, 'First Option', bind: id_select, id: 'span_select_tag' %>