ruby on rails 3 - Escaping text so it would remain readable -
i have method looks this
def full "#{self.first} #{self.second}" end
problem want escape it, in model do
def full erb::util.h("#{self.first} #{self.second}") end
but if first
or second
have &
in it, give me &
instead of &
if have apostrphies '
escape them , make unreadable..
is there way avoid xss , make string readable well?
i think can use html_escape
click here...
Comments
Post a Comment