Skip to content

Instantly share code, notes, and snippets.

@jeanpaulsio
Created April 18, 2017 21:01
Show Gist options
  • Save jeanpaulsio/0e422031eeca56097779f30554adf315 to your computer and use it in GitHub Desktop.
Save jeanpaulsio/0e422031eeca56097779f30554adf315 to your computer and use it in GitHub Desktop.
Coupon Form - Before Refactor
<%= form_for @coupon do |f| %>
<% if @coordinator.stripe_coupon %>
<%= @coordinator.stripe_coupon.id %> (<%= @coordinator.coupon_discount %>)
<% end %>
<%= f.text_field :stripe_id, placeholder: "#{ @coordinator.stripe_coupon ? 'Update Promo Code' : 'Promo Code'}",
value: "#{@coordinator.stripe_coupon ? @coordinator.stripe_coupon.id : nil }" %>
<%= f.submit "#{ @coordinator.stripe_coupon ? 'Update' : 'Save'}", class:'btn btn-info btn-block' %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment