Re: can all methods be made to fit REST?

Michael Ivey
2007-10-18T18:18:20Z

On Oct 18, 12:29 pm, Ant
<email2a...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> For example can anybody think what model I would use for
> forgot_password and reset_password. I have a user model that has a
> password as a field. I do not really want to have a password model
> since I guess this is supposed to map to a password table in the
> database.

Putting on my "Everything can be restfully modeled" hat, what about
this?

map.resources :forgotten_passwords

The new form would have a field for email address.  Create would call
logic in User to do the reset.  The link would be sent to the user,
using the reset code as the ID for forgotten_passwords

http://app.com/forgotten_passwords/123456asswqdwqj1221312321

The show on the forgotten password would have a form to put to the
user resource and change the pass.

Actually, now that I say all that, it doesn''t seem nearly as crazy as
I thought it would.  That''s pretty clean.