[Rails] Extra Fields?

Alexey Verkhovsky alex at verk.info
Thu Nov 11 20:55:43 GMT 2004


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


More information about the Rails mailing list