<% flash.each do |key, value| %>
<%= value %>
<% end %> <% if @html_variant.errors.any? %>

<%= pluralize(@html_variant.errors.count, "error") %> prohibited this block from being saved:

<% end %> <%= form_for(@html_variant) do |f| %> <% if @html_variant.new_record? %> <%= f.label :name %> <%= f.text_field :name, placeholder: "Unique, descriptive name" %> <% end %> <%= f.label :html %> <%= f.text_area :html, placeholder: "HTML to be shown. Make sure all CSS is properly scoped, and all HTML tags are closed, etc. Manditory field." %>
<%= f.label :published %> <%= f.check_box :published %> <%= f.label :group %> <%= f.select(:group, options_for_select(HtmlVariant::GROUP_NAMES, @html_variant.group || "article_show_below_article_cta")) %>
<%= f.submit %> <% end %> <% if @html_variant.html.present? %>

Preview:

<%= @html_variant.html.html_safe %>
<% if @html_variant.group == "article_show_below_article_cta" %>
<%= @html_variant.html.html_safe %>
<% end %> <% end %>