Sha256: e3bfad8d6bd53b24dfe99dca11c30e87f2782d6a27aac84acf41315f0b8d7168
Contents?: true
Size: 1.19 KB
Versions: 5
Compression:
Stored size: 1.19 KB
Contents
# # записано fearlessstar / shadows.of.unevenness@gmail.com холодным летом 2017, за бортом + 13 # document.addEventListener 'turbolinks:load', -> $ -> console.log 'привет, регистрация на связи' $('#reg-button').unbind 'click' $('#reg-button').click -> nickname = $('input[name="field-nickname"]').val() email = $('input[name="field-email"]').val() phone = $('input[name="field-phone"]').val() password = $('input[name="field-password"]').val() $.ajax( method: 'POST' url: '/clients' data: client: email: email nickname: nickname phone: phone password: password).done (response) -> console.log "response#{response}" switch response.state when 'ok' window.location.href = response.url when 'bad' $().reg_errors_default_all for detail in response.details $('#' + detail + '-notice .enter-notice').addClass 'active' when 'shit' $().user_feedback("red", response.details[0])
Version data entries
5 entries across 5 versions & 1 rubygems