Class: TableHelper::HtmlElement

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::TagHelper
Defined in:
lib/table_helper/html_element.rb

Overview

Represents an HTML element

Modifying HTML options

HTML options can normally be specified when creating the element. However, if they need to be modified after the element has been created, you can access the properties like so:

r = Row.new
r[:style] = 'display: none;'

or for a cell:

c = Cell.new
c[:style] = 'display: none;'

Direct Known Subclasses

Body, Cell, CollectionTable, Footer, Header, Row

Instance Method Summary (collapse)

Constructor Details

- (HtmlElement) initialize(html_options = {})

:nodoc:



22
23
24
# File 'lib/table_helper/html_element.rb', line 22

def initialize(html_options = {}) #:nodoc:
  @html_options = html_options.symbolize_keys
end

Instance Method Details

- (Object) html

Generates the html representing this element



27
28
29
# File 'lib/table_helper/html_element.rb', line 27

def html
  (tag_name, content, @html_options)
end