How can I use the selected value in form for alerts?
Is there a way to get it by getElementById
or equivalent?
Form
= f.select :some_key, some_array
`= f.submit 'Submit', data: { confirm: t('views.confirm.caution', :choice => some_array[<CHOSEN INDEX HERE>]) }`
en.yml
en:
views:
confirm:
caution: "Are you sure to submit %{choice} ?"
en.yml
form.slim