Insert only field

Hello,

I am new to RoR. I have situation that cannot find solution. I use the
same user model for signup to system and edit user profile. How to
make username field just insertable and not updatable? Is it possible
to restrict this in model?

On Jun 6, 2007, at 2:02 PM, Jon wrote:

Hello,

I am new to RoR. I have situation that cannot find solution. I use the
same user model for signup to system and edit user profile. How to
make username field just insertable and not updatable? Is it possible
to restrict this in model?

Yes, with validations. You can have different validations rules for
create and update.

http://api.rubyonrails.com/classes/ActiveRecord/Validations.html