def spans resources, options = {}, &block
      return unless resources.is_a?(Array) || resources.is_a?(ActiveRecord::Relation)
      options[:span] ||= 4
      options[:slice] ||= 12/options[:span]
      options[:fluid] ||= false
      klass = options[:fluid] ? "row-fluid" : "row"
      ret = "".html_safe

      resources.each_slice(options[:slice]) do |slice|
        ret += content_tag :div, :class=>klass do
          slice.inject("".html_safe) do |sum, resource|
            send_args = resource.is_a?(ActiveRecord::Base) ? [:content_tag_for, :div, resource] : [:content_tag, :div]
            send_args << {:class => "span#{options[:span]}"}
            sum + send(*send_args) do
              capture(resource, &block)
            end
          end
        end
      end
      ret
    end
def spans resources, options = {}, &block
      return unless resources.is_a?(Array) || resources.is_a?(ActiveRecord::Relation)
      options[:span] ||= 4
      options[:slice] ||= 12/options[:span]
      options[:fluid] ||= false
      klass = options[:fluid] ? "row-fluid" : "row"
      ret = "".html_safe

      resources.each_slice(options[:slice]) do |slice|
        ret += content_tag :div, :class=>klass do
          slice.inject("".html_safe) do |sum, resource|
            send_args = resource.is_a?(ActiveRecord::Base) ? [:content_tag_for, :div, resource] : [:content_tag, :div]
            send_args << {:class => "span#{options[:span]}"}
            sum + send(*send_args) do
              capture(resource, &block)
            end
          end
        end
      end
      ret
    end
Options
 span:: integer between 1..12. Item size.
 slice:: integer between 1..12. Items per slice (row).
 fluid:: boolean. Whether the div tag is fluid.