Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created September 28, 2018 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmiller1990/027703a2b67eeb3879c3bde1bace764d to your computer and use it in GitHub Desktop.
Save lmiller1990/027703a2b67eeb3879c3bde1bace764d to your computer and use it in GitHub Desktop.
<% if flash.present? %>
<% flash[:errors].each do |msg| %>
<%= content_tag :div, msg %>
<% end %>
<% end %>
<%= form_with model: @post, local: true do |f| %>
<%= f.label :title %>
<%= f.text_field :title %>
<%= f.label :body %>
<%= f.text_area :body %>
<%= f.select :category_id do %>
<%= options_from_collection_for_select(Category.all, :id, :name) %>
<% end %>
<%= f.submit %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment