<%= form_for(@snippet) do |f| %>
  <% if @snippet.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@snippet.errors.count, "error") %> prohibited this snippet from being saved:</h2>

      <ul>
      <% @snippet.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :language %><br>
    <%= f.number_field :language %>
  </div>
  <div class="field">
    <%= f.label :content %><br>
    <%= f.text_area :content %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

<%= form_for(@snippet) do |f| %>
  <% if @snippet.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@snippet.errors.count, "error") %> prohibited this snippet from being saved:</h2>

      <ul>
      <% @snippet.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :title %><br>
    <%= f.text_field :title %>
  </div>
  <div class="field">
    <%= f.label :language %><br>
    <%= f.select :language, Snippet.languages.keys.map { |k| [k.humanize, k] } %>
  </div>
  <div class="field">
    <%= f.label :content %><br>
    <%= f.text_area :content %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

Use dropdown field for snippet language in form
Use dropdown field for snippet language in form
