How to get selected option in dropdown menu?

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

<% @quiz.codes.each do |code| %> <%= simple_format code.code %> <%= simple_format code.notes %> <%= form_with(model: [ code, code.student_answers.build ], local: true) do |form| %>

								<%= form.select(:correct_answer_ids, code.correct_answers.pluck(:variable, :variable), {prompt: 'Choose variable'}, class: 'answer-variable')%>
								<%= form.select(:correct_answer_ids, code.correct_answers.pluck(:role, :role), {prompt: 'Choose role'}, class: 'answer-role')%>
							</p>
							<% end %>
						</td>
					</tr>
				<% end %>
			</tbody>

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