Sha256: f70e30ed35a91212357b930180ee4627beafa1296fd901a9cce6330e831c8d62
Contents?: true
Size: 565 Bytes
Versions: 2
Compression:
Stored size: 565 Bytes
Contents
module TableCloth module Columns class Action < Column def value(object, view_context, table) actions_html = actions.inject('') do |links, action| if action.available?(table) links + "\n" + view_context.capture(object, view_context, &action.options[:proc]) else links end end view_context.raw(actions_html) end def actions @actions ||= [] end def available?(table) actions.any? {|a| a.available?(table) } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
table_cloth-0.1.2 | lib/table_cloth/columns/action.rb |
table_cloth-0.1.1 | lib/table_cloth/columns/action.rb |