html symbols in database get converted to &lg &gt in views

63 views
Skip to first unread message

fugee ohu

unread,
May 8, 2017, 10:50:01 AM5/8/17
to Ruby on Rails: Talk
database tables contain <tr><td>...
when view renders < gets converted to &lt and > to &gt
why is this happening?

Colin Law

unread,
May 8, 2017, 11:03:43 AM5/8/17
to Ruby on Rails: Talk
To stop html injection
https://deadliestwebattacks.com/html-injection-quick-reference/

By the way did you solve your last issue (p==@posts.last)? You did not
reply to my question, which is not good manners.

Colin

fugee ohu

unread,
May 8, 2017, 11:11:05 AM5/8/17
to Ruby on Rails: Talk
Thanks, It works without the question mark at the end 
if p==@posts.last
 
Reply all
Reply to author
Forward
0 new messages