i have form users can fill out, , hitting "create" button issue post request create new entry in database form data.
now, logged in users should allowed create database entry, want users able fill out form. when clicking "create" want application redirect users not logged in login page. once logged in, want continue processing post request , create database entry, without user having enter form data again.
what's best way of handling that? putting post data in session? then, after successful login, want create database entry in original controller/action (so not duplicate code), , issuing post request within application (in after-successful-login-method) seems strange. better ideas?
thanks!
you're not mentioning how authentication, suspect manually. if use(and recommend do), gem devise registration, need add devise's authentication helper controllers, that.
to manually, every time user registers, set session id variable tied him/her. then, check see whether he/she registered. if not, not allow action , redirect.
Comments
Post a Comment