class RailsTableFor::Elements::BlockColumn

Attributes

block[R]
title[R]

Public Class Methods

new(block, **options) click to toggle source
# File lib/rails_table_for/elements/block_column.rb, line 16
def initialize(block, **options)
  @block = block
  @title = options[:title]
  @auto_link_enabled = options[:auto_link] || false
end

Public Instance Methods

td(record) click to toggle source
# File lib/rails_table_for/elements/block_column.rb, line 22
def td(record)
  text = block.call(record)
  content = auto_link_enabled ? auto_link(record, text) : text
  content_tag :td, content
end