In your typical each loop in Rails, how do I determine the last object, because I want to do something different to it than the rest of the objects.
<% @stuff.each do |thing| %> <% end %>
@stuff.each do |s| ...normal stuff... if s == @stuff.last ...special stuff... end end
1.4m articles
1.4m replys
5 comments
57.0k users