def smart_listing_for name, *args, &block
      raise ArgumentError, "Missing block" unless block_given?
      name = name.to_sym
      options = args.extract_options!
      bare = options.delete(:bare)

      builder = Builder.new(name, @smart_listings[name], self, options, block)

      output = ""

      data = {}
      data[smart_listing_config.data_attributes(:max_count)] = @smart_listings[name].max_count if @smart_listings[name].max_count && @smart_listings[name].max_count > 0
      data[smart_listing_config.data_attributes(:item_count)] = @smart_listings[name].count
      data[smart_listing_config.data_attributes(:href)] = @smart_listings[name].href if @smart_listings[name].href
      data[smart_listing_config.data_attributes(:callback_href)] = @smart_listings[name].callback_href if @smart_listings[name].callback_href
      data.merge!(options[:data]) if options[:data]

      if bare
        output = capture(builder, &block)
      else
        output = content_tag(:div, :class => smart_listing_config.classes(:main), :id => name, :data => data) do
          concat(content_tag(:div, "", :class => smart_listing_config.classes(:loading)))
          concat(content_tag(:div, :class => smart_listing_config.classes(:content)) do
            concat(capture(builder, &block))
          end)
        end
      end

      output
    end
def smart_listing_for name, *args, &block
      raise ArgumentError, "Missing block" unless block_given?
      name = name.to_sym
      options = args.extract_options!
      bare = options.delete(:bare)

      builder = Builder.new(name, @smart_listings[name], self, options, block)

      output = ""

      data = {}
      data[smart_listing_config.data_attributes(:max_count)] = @smart_listings[name].max_count if @smart_listings[name].max_count && @smart_listings[name].max_count > 0
      data[smart_listing_config.data_attributes(:item_count)] = @smart_listings[name].count
      data[smart_listing_config.data_attributes(:href)] = @smart_listings[name].href if @smart_listings[name].href
      data[smart_listing_config.data_attributes(:callback_href)] = @smart_listings[name].callback_href if @smart_listings[name].callback_href
      data.merge!(options[:data]) if options[:data]

      if bare
        output = capture(builder, &block)
      else
        output = content_tag(:div, :class => smart_listing_config.classes(:main), :id => name, :data => data) do
          concat(content_tag(:div, "", :class => smart_listing_config.classes(:loading)))
          concat(content_tag(:div, :class => smart_listing_config.classes(:content)) do
            concat(capture(builder, &block))
          end)
        end
      end

      output
    end
Outputs smart list container