Rails Comments on View if-end statement screw up rendering on Linux/Apache/FastCGI
the following code does work under my Windows development environment, but not on my production Linux/Apache2/FastCGI env.
in my view rhtml file :
<td id='first_column' class='column'>
<% content_for :head do #DO NOT CACHE THIS content for : HEAD %>
<%= stylesheet_link_tag('live_tree') %>
<%= javascript_include_tag "live_tree" %>
<% end #content_for %>
<div id='contentpanel_13B'>
<div id='category_howtos_container'>
开发者_如何学编程 <%= render :partial => 'howtos_for_category'%>
</div>
</div>
<% cache('category_gadget'+I18n.locale.to_s) do %>
<div class='main_container gadget' id='categories_container'>
<%= render :partial => 'categories' %>
</div>
<% end %>
</td>
This code does not render the div contentpanel_13B under linux... I isolated the problem to the comment on this line :
<% end #content_for %>
I tried under Rails 2.3.2 and 2.3.3 without success... any hints?
It could be the comment is preventing the '%>' from being parsed
Try putting the comment on its own line
<% end
#content_for
%>
I got same issue with <% cache(...) do %>
some cached html <% end # some comment %>
block and putting comment on its own line didn't work for me. I had to do : <% cache do(...) %>
some cached html % end %><% some comment %>
精彩评论