Reputation: 6787
I have defined attribute is_first for table items.
In model Item, i want to set value of this attribute based upon whether an item exits before or not.
I don't want is_first attribute to be writeable. Please suggest what should i do?
Upvotes: 3
Views: 2580
Reputation: 10412
you need to use attr_readonly in your model file:
attr_readonly :is_first
Upvotes: 9