Sha256: b209a21554da37cb2fbffc0524ecfc5e18cf80dd550d457d4983df3e8ed45c76

Contents?: true

Size: 618 Bytes

Versions: 4

Compression:

Stored size: 618 Bytes

Contents

module Trestle
  class Table
    class SelectColumn
      attr_reader :table, :options

      def initialize(table, options={})
        @table, @options = table, options
      end

      def renderer(template)
        Renderer.new(self, template)
      end

      class Renderer < Column::Renderer
        def header
          @template.check_box_tag ""
        end

        def content(instance)
          @template.check_box_tag "selected[]", instance.to_param, false, id: nil
        end

        def classes
          "select-row"
        end

        def data
          {}
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
trestle-0.9.2 lib/trestle/table/select_column.rb
trestle-0.9.1 lib/trestle/table/select_column.rb
trestle-0.9.0 lib/trestle/table/select_column.rb
trestle-0.8.13 lib/trestle/table/select_column.rb