Design an api using rails and change the forgot password functionality

Posted by ragupathi on Stack Overflow See other posts from Stack Overflow or by ragupathi
Published on 2012-11-16T04:09:08Z Indexed on 2012/11/16 5:00 UTC
Read the original article Hit count: 228

I have been using rails for developing web applications and now i need to do design an api for iphone application and since i used respond to json it also produces json but i use devise for authentication in my web application and when i send email and password along with the api it gives out

{"user":{"authentication_token":"Lsusyd27ewgasga63","email":"[email protected]"}}

and there is forgot password functionality in the iphone app but in the web application when clicking on forgot password button it sends an email to the users email, whereby the user has to go to his mail and click on the link sent and it will take to the change password path and after changing it the user will be login but in this iphone app i want to send the password to the user mail and the user can use that password and login. How can i do this? Also do i have to create new controllers for api or the web application controller is enough if it respond as json? please help me.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby-on-rails-3