How to get selected option in dropdown menu?

I was wondering how to get the selected option in dropdown menu.

<% do |code| %> <%= simple_format code.code %> <%= simple_format code.notes %> <%= form_with(model: [ code, ], local: true) do |form| %>

								<%=, code.correct_answers.pluck(:variable, :variable), {prompt: 'Choose variable'}, class: 'answer-variable')%>
								<%=, code.correct_answers.pluck(:role, :role), {prompt: 'Choose role'}, class: 'answer-role')%>
							<% end %>
				<% end %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs