Sha256: 0e1392a528ffe20fcbeb8169a244f00636c3a801553a9c48de0e004febe517c5

Contents?: true

Size: 412 Bytes

Versions: 9

Compression:

Stored size: 412 Bytes

Contents

module FuturismHelper
  def futurize(records, extends: :tr, &block)
    placeholder = capture(&block)
    Array(records).map { |record|
      case extends
      when :tr
        content_tag :tr, placeholder, data: { sgid: record.to_sgid.to_s }, is: "futurism-table-row"
      else
        content_tag :"futurism-element", placeholder, data: { sgid: record.to_sgid.to_s }
      end
    }.join.html_safe
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
futurism-0.3.3 lib/futurism/helpers.rb~
futurism-0.3.2 lib/futurism/helpers.rb~
futurism-0.3.1 lib/futurism/helpers.rb~
futurism-0.3.0 lib/futurism/helpers.rb~
futurism-0.2.0 lib/futurism/helpers.rb~
futurism-0.1.4 lib/futurism/helpers.rb~
futurism-0.1.2 lib/futurism/helpers.rb~
futurism-0.1.1 lib/futurism/helpers.rb~
futurism-0.1.0 lib/futurism/helpers.rb~