Class: Uchi::Ui::Index::RecordsTable
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Uchi::Ui::Index::RecordsTable
- Defined in:
- app/components/uchi/ui/index/records_table.rb,
app/components/uchi/ui/index/records_table/search_form.rb
Defined Under Namespace
Classes: SearchForm
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the columns to be displayed in this table.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#records ⇒ Object
readonly
Returns the value of attribute records.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#sort_order ⇒ Object
readonly
Returns the value of attribute sort_order.
Instance Method Summary collapse
-
#initialize(columns:, records:, repository:, query: nil, scope: nil, sort_order: nil) ⇒ RecordsTable
constructor
A new instance of RecordsTable.
- #path_for_edit(record) ⇒ Object
Constructor Details
#initialize(columns:, records:, repository:, query: nil, scope: nil, sort_order: nil) ⇒ RecordsTable
Returns a new instance of RecordsTable.
13 14 15 16 17 18 19 20 21 |
# File 'app/components/uchi/ui/index/records_table.rb', line 13 def initialize(columns:, records:, repository:, query: nil, scope: nil, sort_order: nil) super() @columns = columns @query = query @sort_order = sort_order @records = records @repository = repository @scope = scope end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the columns to be displayed in this table. Each column is a representation of a Field from repository. Defaults to all fields.
9 10 11 |
# File 'app/components/uchi/ui/index/records_table.rb', line 9 def columns @columns end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
11 12 13 |
# File 'app/components/uchi/ui/index/records_table.rb', line 11 def query @query end |
#records ⇒ Object (readonly)
Returns the value of attribute records.
11 12 13 |
# File 'app/components/uchi/ui/index/records_table.rb', line 11 def records @records end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
11 12 13 |
# File 'app/components/uchi/ui/index/records_table.rb', line 11 def repository @repository end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
11 12 13 |
# File 'app/components/uchi/ui/index/records_table.rb', line 11 def scope @scope end |
#sort_order ⇒ Object (readonly)
Returns the value of attribute sort_order.
11 12 13 |
# File 'app/components/uchi/ui/index/records_table.rb', line 11 def sort_order @sort_order end |
Instance Method Details
#path_for_edit(record) ⇒ Object
23 24 25 |
# File 'app/components/uchi/ui/index/records_table.rb', line 23 def path_for_edit(record) repository.routes.path_for(:edit, id: record.id, scope: scope) end |