Q:

How to remove id & name attributes from rails view helper

Rails generates id and name for select_tag from name argument by default:
select_tag "people", "<option>David</option>".html_safe
# => <select id="people" name="people"><option>David</option></select>

But what if we want to generate select without and id and name attributes?
Like this:
<select><option>David</option></select>

Empty name argument doesn't work, empty html attributes still exists:
select_tag "", "<option>David</option>".html_safe
# => <select id name><option>David</option></select>

Manual id and name assign doesn't work
select_tag "people", "<option>David</option>".html_safe, id: false, name: false
# => <select id=false name=false><option>David</option></select>
select_tag "people", "<option>David</option>".html_safe, id: '', name: ''
# => <select id name><option>David</option></select>

A:

id and name can be removed by assigning nil to it:
select_tag nil, "<option>David</option>".html_safe, id: nil
# => <select><option>David</option></select>

