Adding attributes to Model


I add public property to model and try to initialize this property from posted form.


but my public proterty doesn’t get value. Any idea ? How can I add new attribute a model.


You have to define your property as safe in the validation rules cause you are doing a massive assignment.


Guide - Securing attribute assignments

Wiki - Understanding "Safe" validation rules

There is also a wiki article about virtual attributes which might help you.