<% if comment.state.to_s.downcase == 'spam'%> <%= render :partial => 'spam', :locals => { :comment => comment } %> <% else %> <%= render :partial => 'ham', :locals => { :comment => comment } %> <% end %>