Sha256: 2ef007111a0ca25685a7a5596235f0a51b357abfddf12307d731b5d1a2b3862f

Contents?: true

Size: 903 Bytes

Versions: 1

Compression:

Stored size: 903 Bytes

Contents

require_relative '../../../table_me/table_me_presenter'
module TableMe

  # Controller
  # A table must first be created in your controller using the table_me method.

  # table_me(collection, options)
  # The collection can be two things, first an ActiveRecord::Relation, which 
  # is the result of some sort of active record query ex:

  # table_me( User.where(subscribed: true) )
  # Keep in mind that doing User.all just returns an array of objects, not the a relation.

  # In order to do the equivalent of the .all just pass in the ActiveRecord class:

  # table_me( User )
  # Possible options available for this method are:

  # name - Label for the the table
  # per_page - The amount of items per page of the table
  
  module TableMeHelper
    def table_me(model, options = {})
      table_presenter = TableMePresenter.new(model, options,params)
      table_presenter.name
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
table_me-0.0.1 lib/table_me/table_me_helper/table_me_helper.rb