box-o-sand/oldstuff/map-mash/app/views/mashes/new.html.haml

23 lines
608 B
Plaintext

- content_for :head_js do
:javascript
$(function() {
$('.mash-image').click(function(elem) {
$('#mash_winner_id').val($(elem.target).attr('data-map-id'));
$('form[id^="edit_mash_"]').submit();
});
});
%h1 Mash the Maps!
%p Choose your fave.
- form_for(@mash) do |f|
= f.error_messages
#maps
#map_a.mash-image
%image{:src => "#{url_for @mash.map_a}.png", :'data-map-id' => @mash.map_a.id}
#map_b.mash-image
%image{:src => "#{url_for @mash.map_b}.png", :'data-map-id' => @mash.map_b.id}
= f.hidden_field :winner_id, :value => '?'