<% if level != max_level && level > 1 %> <td colspan="<%=max_level-level%>" class="grouptd last"></td> <% end %>
Refactorings
No refactoring yet !
foobar
April 16, 2009, April 16, 2009 20:19, permalink
content_tag(:td, '', :colspan => (max_level - level), :class => 'grouptd last') if (level > 1 && level < max_level)
Adam
April 16, 2009, April 16, 2009 23:21, permalink
Are you sure you really want to use level and max_level at all? Where are those attributes coming from?
Josh N
April 17, 2009, April 17, 2009 03:13, permalink
does max_level mean the maximum? then it would be level > 0 && level < max_level which could be made a candidate for the Range#include? method
<% if (1..max_level).include?(level) %> <td colspan="<%=max_level-level%>" class="grouptd last"></td> <% end %>
Curious of the right way to perform this. Definitely new to ruby. Thanks!