In rails, we can access the db column through the provided attribute rails, but can we change this? for example, I have db with a column with a name, I can implement something like.
def name
"sir" + name
end
I tried, but this leads to a stack overflow. There is a way to do this.
more questions if there is a difference between the name and self.name.
source
share