d834b81003
git-subtree-dir: map-mash git-subtree-mainline:eacc351b17
git-subtree-split:7f16409d12
23 lines
608 B
Plaintext
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 => '?'
|