app/views/subjects/_form.html.erb
<%= render "layouts/navbar" %>
<%= form_for (@subject) do |f| %>
<% if @subject.errors.any? %>
<div class="container">
<div class="text-danger text-justify">
<div id="error_explanation">
<h2 class=""><%= pluralize(@subject.errors.count, "erro") %> proibiram este formulario de ser salvo:</h2>
<ul>
<% @subject.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
</div>
</div>
<% end %>
<div class="form-group">
<%= f.label :name_subject, class:"sr-only" %>
<div class="input-group">
<span class="input-group-addon">
<span class="fa fa-user"></span>
Nome
</span>
<%= f.text_field :name_subject, class:"form-control", placeholder:"Nome da matéria" %>
</div>
</div>
<div class="form-group">
<%= f.label :classroom_id, class:"sr-only", id: "sel1" %>
<div class="input-group">
<span class="input-group-addon">
<span class="fa fa-television"></span>
Série
</span>
<%= f.select :classroom_grade_id, @classroom_grades.collect {|classroom_grade| [classroom_grade.name_classroom_grade, classroom_grade.id]}, {:include_blank => false}, {:class => "form-control", :id => "sel1"}%>
</div>
</div>
<div class="form-group">
<div class="input-group">
<span class="input-group-addon">
<span class="fa fa-gift"></span>
Matrícula do Professor
</span>
<%= text_field_tag('teacher_registry', nil, placeholder: "123456", class: "form-control") %>
</div>
</div>
<%= f.button '<span class="fa fa-check"></span> Salvar'.html_safe, type:"submit", class:'btn btn-lg btn-success' %>
<% end %>