hanzhao
2011-Apr-17 18:43 UTC
why <% concat(csrf_meta_tag) #aa%> is invalid while <% javascript_include_tag :defaults #abc%> is valid?
as the subject said. -- 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.
Michael Pavling
2011-Apr-17 20:02 UTC
Re: why <% concat(csrf_meta_tag) #aa%> is invalid while <% javascript_include_tag :defaults #abc%> is valid?
On 17 April 2011 19:43, hanzhao <cx.chenghai-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> why <% concat(csrf_meta_tag) #aa%> is invalid while <% javascript_include_tag :defaults #abc%> is valid?What''s invalid about it? I assume you get some sort of error message... can you post that to enlighten us, please? Personally, though, I find I get problems with Ruby parsing if I comment in ERB tags after code, instead I tend to do this if I desperately want to comment in a view: <% code here %><%# comment here %> -- 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.
Frederick Cheung
2011-Apr-17 20:06 UTC
Re: why <% concat(csrf_meta_tag) #aa%> is invalid while <% javascript_include_tag :defaults #abc%> is valid?
On Apr 17, 7:43 pm, hanzhao <cx.cheng...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> as the subject said.I assume you mean <%= in the second case. The way that erb generates ruby code from a template means that comments aren''t supported - the comment inside the <% tag ends up commenting other bits of the code generated by erb. The only form of comments that are safe is <%# Fred -- 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.