$ -> ssh_submit = -> host = $('#ssh_check_host').val() port = $('#ssh_check_port').val() port = 22 if port == '' window.location.href = "<%= Rails.configuration.relative_url_root %>/ssh/#{host}:#{port}" $('#ssh_check_host').keypress (e) -> ssh_submit() if e.which == 13 return $('#ssh_check_port').keypress (e) -> ssh_submit() if e.which == 13 return $('#ssh_check_submit').click -> ssh_submit() return