Friday, 15 May 2015

ruby on rails - Forgot password Devise gem API -



ruby on rails - Forgot password Devise gem API -

i have been using devise gem in application. able configure devise sessions_controller respond both request web , mobile api call.

but trying see how can utilize forgot password alternative of devise gem mobile api call. can able utilize sign in api below

curl -x post 'http://localhost:3002/users/sign_in.json' -d 'user[email]=balan@test.com&user[password]=123456'

can same forgot password?

got answer.

1) create custom action recieves email input

2) add together below code

@user = user.find_by_email("email@email.com") if @user.present? @user.send_reset_password_instructions render :text => "updated" else render :text => "no such email" end

ruby-on-rails devise

No comments:

Post a Comment