<% @feed.each do |feed| %>
<ul id="feed">
<%=
case feed.action_type
when "COMMENT"
<%= render :partial => "feeds/storyitem" -%>,
end
%>
</ul>
<% end %>
views:
44answers:
2
A:
ok figured it out:
<% @feed.each do |feed| %>
<ul id="feed">
<%=
case feed.action_type
when "COMMENT"
render :partial => "feeds/storyitem"
end
%>
</ul>
<% end %>
no need for the <% around the render partial
WozPoz
2010-09-30 05:31:58
A:
You can't nest ERB tags like that -- you're trying to insert the render...
ERB tag when you're already inside ERB. If that's what you really want to do, try this:
<% @feed.each do |feed| %>
<ul id="feed">
<% case feed.action_type
when "COMMENT" %>
<%= render :partial => "feeds/storyitem" -%>,
<% end %>
</ul>
<% end %>
But unless you've simplified the code example for posting it here, the <% if %>
looks clearer to me.
Graeme Mathieson
2010-09-30 05:32:38