[Rails] Extra Fields?

Tobias Luetke tobias.luetke at gmail.com
Thu Nov 11 21:00:46 GMT 2004


I would recommend against doing the confirm password validation as
part of the model.

This would have the disadvantage that you have to supply password
confirmation whenever want to create a user. Inconvenient for admin
interfaces and especially from IRB.


On Thu, 11 Nov 2004 22:55:43 +0200, Alexey Verkhovsky <alex at verk.info> wrote:
> Russ Smith wrote:
> 
> > I'm wondering how you would go about putting a "confirm password"
> > field into a form and not have it inserted into the database.
> 
> Simple.
> 
> Either in the controller
> 
>   confirm_password = @params['user'].delete('confirm_password')
> 
> or define attr_accessor :confirm_password in the model, it will then be
> assigned by YourModel.create(@params['your_form']), be accessible in
> validate and other callbacks, and will not be written to the database.
> 
> Best regards,
> Alexey Verkhovsky
> 
> 
> _______________________________________________
> Rails mailing list
> Rails at lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
> 


-- 
Tobi
http://blog.leetsoft.com


More information about the Rails mailing list