eggman2001
2008-Apr-08 16:02 UTC
how to output text containing html markup without having the browser render the html
I have an object attribute that constantly gets html inserted into it. This becomes problematic when I want to output that attribute to the browser. What I''d like to do is have the < and > converted to < and >. Is there a snippet or plugin I can use to do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Apr-08 16:18 UTC
Re: how to output text containing html markup without having the browser render the html
> I have an object attribute that constantly gets html inserted into it. > This becomes problematic when I want to output that attribute to the > browser. What I''d like to do is have the < and > converted to < and > >. Is there a snippet or plugin I can use to do this?Assuming your attribute is say @html_string... <%= h @html_string %> -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mark Thomas
2008-Apr-08 16:18 UTC
Re: how to output text containing html markup without having the browser render the html
You mean like the view helper h(), as in <%=h my_attr %>? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
eggman2001
2008-Apr-08 17:20 UTC
Re: how to output text containing html markup without having the browser render the html
Exactly. Thank you. On Apr 8, 12:18 pm, Mark Thomas <r...-gkTqyYPWbQbz1n+OaKNE4w@public.gmane.org> wrote:> You mean like the view helper h(), as in <%=h my_attr %>?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---