%= form_for(plan, url: url) do |f| %>
<% if plan.errors.any? %>
<%= pluralize(plan.errors.count, "error") %> prohibited this plan from being saved:
<% plan.errors.full_messages.each do |message| %>
- <%= message %>
<% end %>
<% end %>
<% if plan.new_record? %>
<%= f.label :stripe_id %>
<%= f.text_field :stripe_id, required: true, class: 'form-control' %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name, required: true, class: 'form-control' %>
<% if plan.new_record? %>
<%= f.label :currency %>
<%= f.select :currency, options_for_select(['usd'], plan.currency), {}, { class: 'form-control' } %>
<%= f.label :amount %>
<%= f.number_field :amount, required: true, min: 0, step: 1, class: 'form-control' %>
<%= f.label :interval %>
<%= f.select :interval, options_for_select(Tang::Plan::INTERVALS, plan.interval), { prompt: true }, { required: true, class: 'form-control' } %>
<%= f.label :interval_count %>
<%= f.number_field :interval_count, min: 1, step: 1, class: 'form-control' %>
<%= f.label :trial_period_days %>
<%= f.number_field :trial_period_days, min: 1, step: 1, class: 'form-control' %>
<% end %>
<%= f.label :statement_descriptor %>
<%= f.text_field :statement_descriptor, maxlength: 22, class: 'form-control' %>
<% if !plan.new_record? %>
<%= f.label :trial_period_days %>
<%= f.number_field :trial_period_days, min: 1, step: 1, class: 'form-control' %>
<% end %>
<%= f.label :highlight, class: 'form-check-label' do %>
<%= f.check_box :highlight, class: 'form-check-input' %> Highlight
<% end %>
<%= f.label :order %>
<%= f.number_field :order, min: 0, step: 1, class: 'form-control' %>
<%= f.label :features %>
<%= f.text_area :features, class: 'form-control' %>
<%= f.label :description %>
<%= f.text_area :description, class: 'form-control' %>
<%= f.label :group %>
<%= f.number_field :group, min: 0, step: 1, class: 'form-control' %>
<%= link_to 'Cancel', url, class: 'btn btn-secondary' %>
<%= f.submit class: 'btn btn-primary' %>
<% end %>