Class: Redde::IndexHelper::IndexBuilder::IndexHeadCellBuilder
- Inherits:
-
Object
- Object
- Redde::IndexHelper::IndexBuilder::IndexHeadCellBuilder
- Includes:
- ActionView::Context, ActionView::Helpers::TagHelper
- Defined in:
- app/helpers/redde/index_helper.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
Instance Method Summary collapse
- #cell(field = nil, options = {}, &block) ⇒ Object
-
#initialize(list) ⇒ IndexHeadCellBuilder
constructor
A new instance of IndexHeadCellBuilder.
Constructor Details
#initialize(list) ⇒ IndexHeadCellBuilder
Returns a new instance of IndexHeadCellBuilder.
170 171 172 |
# File 'app/helpers/redde/index_helper.rb', line 170 def initialize(list) @list = list end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
168 169 170 |
# File 'app/helpers/redde/index_helper.rb', line 168 def list @list end |
Instance Method Details
#cell(field = nil, options = {}, &block) ⇒ Object
174 175 176 177 178 179 180 181 182 |
# File 'app/helpers/redde/index_helper.rb', line 174 def cell field = nil, = {}, &block if field.is_a?(Symbol) || field.is_a?(String) content_tag :th, list.human_attribute_name(field), class: ['list__head', [:class]] elsif field.is_a?(Hash) content_tag :th, "", class: ['list__head', field[:class]] elsif field.nil? content_tag :th, "", class: 'list__head' end end |