I have a legacy application I ported from Rails 2.x. I found that the escaping was occurring where it shouldn''t, like in creation of forms, and I couldn''t turn it off. I found two mechanisms that should have disabled it, a function safe_html, which is supposed to mark a string as not needing to be escaped. The other is raw, which similarly indicates that a string should be output in its raw form, even if it''s not safe HTML. Neither of these mechanisms seem to function for me. Anyone know of something I might have done to muck up this functionality? Is there a problematic gem possibly? Dan -- 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.
On 13 May 2011 04:26, dlamet <dlamet-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> I have a legacy application I ported from Rails 2.x. I found that the > escaping was occurring where it shouldn''t, > Anyone know of something I might have done to muck up this > functionality? Is there a problematic gem possibly?Without knowing what gems you''re using, or showing some code snippets from your views, and maybe the associated controller action, and generated HTML, it''s going to be very vague speculation at best... -- 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.
Are you using helper methods to output the HTML? If so, you can mark them as safe by adding> safe_helper :helper_method_namein the helper file. Then I believe they won''t be escaped. Adam Stegman On May 12, 2011, at 10:26 PM, dlamet wrote:> I have a legacy application I ported from Rails 2.x. I found that the > escaping was occurring where it shouldn''t, like in creation of forms, > and I couldn''t turn it off. I found two mechanisms that should have > disabled it, a function safe_html, which is supposed to mark a string > as not needing to be escaped. The other is raw, which similarly > indicates that a string should be output in its raw form, even if it''s > not safe HTML. Neither of these mechanisms seem to function for me. > Anyone know of something I might have done to muck up this > functionality? Is there a problematic gem possibly? > > Dan > > -- > 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. >-- 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.