Skip to content

Instantly share code, notes, and snippets.

@PavloConan
Created August 21, 2018 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PavloConan/a4c056957d622259a49d07b62f8690dc to your computer and use it in GitHub Desktop.
Save PavloConan/a4c056957d622259a49d07b62f8690dc to your computer and use it in GitHub Desktop.
$(document).on('submit', '#login-form', function(e) {
 e.preventDefault()
 form = $('#login-form').serialize()
 $.ajax({
   data: form,
   dataType: 'json',
   type: 'POST',
   url: Routes.sessions_path(),
   success: function() {
     getData()
   },
   error: function(data) {
     $('.login__container__alert').show().html(data.responseJSON.error)
   }
 })
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment