You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
608 B

- 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 => '?'