dimanche 6 août 2017

Selected option with a select_tag

I have a select_tag, like this:

<%= select_tag(:language_ov, options_for_select([['Français', 'FR'],['Anglais', 'EN']], selected: 'FR'), class:"answer language_ov calcul_checkout chosen-select")%>

But if my user don't re-select the choice by default params[:language_ov] is equal to nil

-> I want to give the default value 'FR' for the params[:language_ov] if my user does not select anything.

Aucun commentaire:

Enregistrer un commentaire