     destroy_product = (store_slug, product_slug, callback) ->
         $.ajax
             url: "/products/#{product_slug}"
-            data:
-                store_slug: store_slug
-                product_slug: product_slug
+            data: {store_slug, product_slug}
             type: 'delete'
             success: (response) ->
                 if response.status is 'success'

        container = $('<div />')
        for user_photo in user_photos.product_photos
            container.append(Mustache.render(templates.product_photo_template, user_photo))
        ($ '#product_form_wrapper').find('.product-photo:last').after(container)
        ($ '.fetch-more-user-photos').data('maxId', user_photos.max_id)

    window.render_user_photos = (user_photos) ->
        ($ '#product_form_wrapper').find('.product-photos')
            .replaceWith(Mustache.render(templates.product_photos_template, user_photos, product_photo: templates.product_photo_template))

    window.render_user_photo_feed = (user_photos) ->
        ($ '#product_form_wrapper').find('.photo-feed')
            .replaceWith(Mustache.render(templates.user_photo_feed_template, user_photos, product_photo: templates.product_photo_template))

    window.fetch_user_photos = (callback = render_user_photos, options = {}) ->

                if confirm("Are you sure you want to delete #{data.name}?")
                    destroy_product(data.storeSlug, data.slug, fetch_and_render_product_widgets)

        $product_form_wrapper
            .on 'click', '.add-instagram-tag', ->
                instagram_tag = ($ '#product_instagram_tag').val()
                if instagram_tag
                    instagram_tag = instagram_tag.split('#')[1] if instagram_tag.indexOf('#') isnt -1
                    ($ '#product_instagram_tag').val('')
                    ($ @).closest('.control-group').append(Mustache.render(templates.product_form_label_template, {value: "##{instagram_tag}", name: 'instagram-tag'}))
                    photos_with_tags = $product_form_wrapper.find(".photo-feed div[data-tags~='#{instagram_tag}']")
                    if photos_with_tags.length > 0
                        photos_with_tags.each -> select_photo(($ @))
                        pluralized_photo = if photos_with_tags.length is 1 then 'photo' else 'photos'
                        pluralized_has =  if photos_with_tags.length is 1 then 'has' else 'have'
                        expire_alert_and_notice_in(6000)
                        update_notice("#{photos_with_tags.length} #{pluralized_photo} from your feed #{pluralized_has} been linked.")

            .on 'click', '.add-size', ->
                size = ($ '#product_sizes').val()
                if size
                    ($ '#product_sizes').val('')
                    ($ @).closest('.control-group').append(Mustache.render(templates.product_form_label_template, {value: size, name: 'size'}))

            .on 'click', '.add-color', ->
                size = ($ '#product_colors').val()
                if size
                    ($ '#product_colors').val('')
                    ($ @).closest('.control-group').append(Mustache.render(templates.product_form_label_template, {value: size, name: 'color'}))

            .on 'click', '.remove-label', ->
                ($ @).parent().remove()

            .on 'click', '.render-new-product-form', ->
                render_new_product_form({storeSlug: gon.store_slug})
                update_h2(Mustache.render(templates.stores_h2_remove_template, {}))

            .on 'click', '.hide-new-product-form', ->
                reset_product_form()

            .on 'submit', 'form', (e) ->
                e.preventDefault()

