Class: IssuesHelper::IssueFieldsRows
- Inherits:
-
Object
- Object
- IssuesHelper::IssueFieldsRows
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- app/helpers/issues_helper.rb
Overview
Instance Method Summary collapse
- #cells(label, text, options = {}) ⇒ Object
-
#initialize ⇒ IssueFieldsRows
constructor
A new instance of IssueFieldsRows.
- #left(*args) ⇒ Object
- #right(*args) ⇒ Object
- #size ⇒ Object
- #to_html ⇒ Object
Constructor Details
#initialize ⇒ IssueFieldsRows
Returns a new instance of IssueFieldsRows
184 185 186 187 |
# File 'app/helpers/issues_helper.rb', line 184 def initialize @left = [] @right = [] end |
Instance Method Details
#cells(label, text, options = {}) ⇒ Object
209 210 211 212 213 214 |
# File 'app/helpers/issues_helper.rb', line 209 def cells(label, text, ={}) [:class] = [[:class] || "", 'attribute'].join(' ') content_tag 'div', content_tag('div', label + ":", :class => 'label') + content_tag('div', text, :class => 'value'), end |
#left(*args) ⇒ Object
189 190 191 |
# File 'app/helpers/issues_helper.rb', line 189 def left(*args) args.any? ? @left << cells(*args) : @left end |
#right(*args) ⇒ Object
193 194 195 |
# File 'app/helpers/issues_helper.rb', line 193 def right(*args) args.any? ? @right << cells(*args) : @right end |
#size ⇒ Object
197 198 199 |
# File 'app/helpers/issues_helper.rb', line 197 def size @left.size > @right.size ? @left.size : @right.size end |
#to_html ⇒ Object
201 202 203 204 205 206 207 |
# File 'app/helpers/issues_helper.rb', line 201 def to_html content = content_tag('div', @left.reduce(&:+), :class => 'splitcontentleft') + content_tag('div', @right.reduce(&:+), :class => 'splitcontentleft') content_tag('div', content, :class => 'splitcontent') end |