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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -