Erwin
2010-Aug-09 11:54 UTC
Rails 3 - Ruby 1.9.2 - cannot output correctly HTML special characters
this is my first Rails3-Ruby 1.9.2 test app.. I cannot out a simple html string w special characters like © copyright = "Copyright © " + " 2010 , TestApp Ltd." using copyright in my view, I see displayed Copyright © 2010, TestApp Ltd. what''s wrong ? what''s missing somewhere (was running well in Rails 2.3-Ruby 1..8.7 ) thanks fyi -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter De Berdt
2010-Aug-09 12:09 UTC
Re: Rails 3 - Ruby 1.9.2 - cannot output correctly HTML special characters
On 09 Aug 2010, at 13:54, Erwin wrote:> this is my first Rails3-Ruby 1.9.2 test app.. > I cannot out a simple html string w special characters like © > > copyright = "Copyright © " + " 2010 , TestApp Ltd." > > using copyright in my view, I see displayed > > Copyright © 2010, TestApp Ltd. > > what''s wrong ? what''s missing somewhere (was running well in Rails > 2.3-Ruby 1..8.7 )HTML escaping is done by default in Rails 3: http://asciicasts.com/episodes/204-xss-protection-in-rails-3 http://www.railsdispatch.com/posts/security http://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/ The solution in is the posts above. Best regards Peter De Berdt -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Erwin
2010-Aug-09 13:38 UTC
Re: Rails 3 - Ruby 1.9.2 - cannot output correctly HTML special characters
Thanks Peter .. I missed that : copyright.html_safe On 9 août, 14:09, Peter De Berdt <peter.de.be...-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> On 09 Aug 2010, at 13:54, Erwin wrote: > > > this is my first Rails3-Ruby 1.9.2 test app.. > > I cannot out a simple html string w special characters like © > > > copyright = "Copyright © " + " 2010 , TestApp Ltd." > > > using copyright in my view, I see displayed > > > Copyright © 2010, TestApp Ltd. > > > what''s wrong ? what''s missing somewhere (was running well in Rails > > 2.3-Ruby 1..8.7 ) > > HTML escaping is done by default in Rails 3: > > http://asciicasts.com/episodes/204-xss-protection-in-rails-3http://www.railsdispatch.com/posts/securityhttp://yehudakatz.com/2010/02/01/safebuffers-and-rails-3-0/ > > The solution in is the posts above. > > Best regards > > Peter De Berdt-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.