Module: Rails::AddOns::TableHelper

Defined in:
app/helpers/rails/add_ons/table_helper.rb

Overview

Provides helpers to render tables for collections and single resources. To use it you have to add it to your controller:

Example:

class PostsController < ApplicationController
  #...
  helper Rails::AddOns::TableHelper
end

Defined Under Namespace

Classes: SortLink

Instance Method Summary collapse

Instance Method Details

#collection_table(options = {}, &block) ⇒ Object


14
15
16
# File 'app/helpers/rails/add_ons/table_helper.rb', line 14

def collection_table(options = {}, &block)
  Component::CollectionTable.new(self, options, &block).perform
end

#resource_table(options = {}, &block) ⇒ Object


18
19
20
# File 'app/helpers/rails/add_ons/table_helper.rb', line 18

def resource_table(options = {}, &block)
  Component::ResourceTable.new(self, options, &block).perform
end

22
23
24
25
# File 'app/helpers/rails/add_ons/table_helper.rb', line 22

def sort_link(column_name, title, options = {})
  return title if options === false
  SortLink.new(self, column_name, title, options).perform
end