.row .span4 %h3 People %table.table.people-list - @membership_award.people.each do |person| %tr %td.name = person %br = person.email .span8 %h3 Membership =form_for @membership_award, :html => { :class => 'form-horizontal' } do |form| .control-group = form.label "Membership Type", :class => 'control-label' .controls = form.select :membership_type, options_from_collection_for_select(@membership_types, 'id', 'name', @membership_award.membership_type) .control-group = form.label "Number of Memberships", :class => 'control-label' .controls = form.text_field :number_of_memberships .control-group = form.label "Notes", :class => 'control-label' .controls = form.text_area :notes, :rows => 2, :class => "span3" .control-group = form.label "Expires On", :class => 'control-label' .controls = form.text_field :ends_at, :class => :datepicker .control-group = form.label "Price per membership", :class => 'control-label' .controls .input-prepend %span.add-on $ = form.text_field :sold_price, :class => 'span1' .control-group .controls %label.radio = form.radio_button :send_email, false Do not notify these patrons. %label.radio = form.radio_button :send_email, true Notify these patrons by email and include the following message: .control-group .controls = form.text_area :message, :rows => 5, :class => "span5" .form-actions =form.submit "Next", :class => 'btn' - content_for :custom_js do :javascript var ends_at_data = #{@membership_types_hash.to_json} $('#membership_award_membership_type').change(function () { $('#membership_award_ends_at').val(ends_at_data[$('#membership_award_membership_type').val()]) }) $('#membership_award_send_email_false').click(function () { $('#membership_award_message').hide() }) $('#membership_award_send_email_true').click(function () { $('#membership_award_message').show() }) $(document).ready(function() { if ($('input[name="membership_award[send_email]"]:checked').val() == true) { $('#membership_award_message').show() } else { $('#membership_award_message').false() } })