Prompt property is not working

1
<div class="field col-xs-3">
          <%= f.label :modelo_id %>
          <%= f.select :modelo_id, 
            options_for_select(
              @modelos.collect { |modelo|
              [modelo.nome.titleize, modelo.id] }, @carro.submodelo.modelo.id), {}, { id: 'modelos_select', class: 'form-control'  }, prompt: 'Selecionar disciplina' %>
        </div>

Could someone tell me why the prompt is not working?

    
asked by anonymous 22.10.2016 / 19:39

1 answer

0

You need to put prompt within hash of html_options , try as follows:

<div class="field col-xs-3">
          <%= f.label :modelo_id %>
          <%= f.select :modelo_id, 
            options_for_select(
              @modelos.collect { |modelo|
              [modelo.nome.titleize, modelo.id] }, @carro.submodelo.modelo.id), {}, 
              { id: 'modelos_select', class: 'form-control'  , prompt: 'Selecionar disciplina' } %>
 </div>
    
24.10.2016 / 18:58