|
|
|
|
|
by badclient
5439 days ago
|
|
Thanks for the reply! Let's say I add a few more things to that controller: namely ability to check if account is disabled(and to disable after x attempts and notify user) or if a captcha needs to be shown or was shown etc. I feel before you know it the controller can get fairly complicated with all the asserts in real-life scenarios. May be the orig author is ok with it but reading the post I started getting ideas about simple 5-10 line controllers. |
|
In Rails, :except and :only are super useful on filters.
Also, another possibility is to noun-ify some verbs. (Some may prefer to call it resource-ification, or REST-ification)
For example, you could create a PasswordResetRequest model, which handles all of the logic for checking the old password, the password confirmation, the new password's complexity, etc. Then it would be responsible for executing the actual password change as well.
As a bonus, noun-ification enables easy logging because you'll already have a data structure to store.