Check if user credentials are correct in Login page without reloading the page? [Rails] -


so noticed neat thing on zapier's login page. when enter wrong credentials , click on 'login', gives 'incorrect email or password' error without reloading page. how being done? , how can replicate in rails app devise?

without providing code, rather general answer, here go:

in order create asynchronous request, want hook sort of javascript (jquery, angularjs, ...) issues asynchronous request (keyword: ajax) ruby on rails controller. make sure include username/password params controller evaluate ;)

depending on entered information , desired behavior, controller respond json (something simple render json: true, status: 200 should job.) then, evaluated on clientside again, either show error or redirect user further.

this tutorial may on way: https://hackhands.com/sign-users-ajax-using-devise-rails/

good luck!


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -