property Prompt is not working

Asked

Viewed 20 times

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>

Would someone tell me why the prompt isn’t working?

1 answer

0


You need to put the prompt within the 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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.