Skip to content

Instantly share code, notes, and snippets.

@jeanpaulsio
Created April 18, 2017 23:01
Show Gist options
  • Save jeanpaulsio/f500d56e762fd1f5358bd0264865eb85 to your computer and use it in GitHub Desktop.
Save jeanpaulsio/f500d56e762fd1f5358bd0264865eb85 to your computer and use it in GitHub Desktop.
<%= form_for @coupon do |f| %>
<% if @coupon_service.stripe_coupon %>
<%= @coupon_service.stripe_coupon_id %> (<%= @coupon_service.discount %>)
<% end %>
<%= f.text_field :stripe_id, placeholder: "#{ @coupon_service.stripe_coupon ? 'Update Promo Code' : 'Promo Code'}", value: "#{@coupon_service.stripe_coupon ? @coupon_service.stripe_coupon_id : nil }", :required => true %>
<%= f.submit "#{ @coupon_service.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