% flash.each do |key, value| %>
<%= value %>
<% end %>
<% if @html_variant.errors.any? %>
<%= pluralize(@html_variant.errors.count, "error") %> prohibited this block from being saved:
<% @html_variant.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% 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 :target_tag %>
<%= f.text_field :target_tag, placeholder: 'One tag, e.g. javascript. Optional targeting.' %>
<%= f.submit %>
<% end %>
<% if @html_variant.html.present? %>
Preview:
<%= @html_variant.html.html_safe %>
<% end %>