Skip to content

Instantly share code, notes, and snippets.

@JFickel
Created October 12, 2013 07:00
Show Gist options
  • Save JFickel/6946723 to your computer and use it in GitHub Desktop.
Save JFickel/6946723 to your computer and use it in GitHub Desktop.
$('.bracket').on('click', 'button.slot', () ->
$.ajax(
type: 'PUT'
url: $('.update_path').text()
data:
position: $(this).data('position')
)
)
def update
tournament = Tournament.find(params[:id])
if params[:position]
tournament.advance(params[:position].map{|e| e.to_i })
elsif params[:start]
tournament.start
end
redirect_to request.referer
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment