Class: MenuHelper::HtmlElement
- Inherits:
-
Object
- Object
- MenuHelper::HtmlElement
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/menu_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:
m = Menu.new
m[:style] = 'display: none;'
or for a menu bar:
b = MenuBar.new
b[:style] = 'display: none;'
Instance Method Summary (collapse)
-
- (Object) html
Generates the html representing this element.
-
- (HtmlElement) initialize(html_options = {})
constructor
:nodoc:.
Constructor Details
- (HtmlElement) initialize(html_options = {})
:nodoc:
22 23 24 |
# File 'lib/menu_helper/html_element.rb', line 22 def initialize( = {}) #:nodoc: @html_options = .symbolize_keys end |
Instance Method Details
- (Object) html
Generates the html representing this element
27 28 29 |
# File 'lib/menu_helper/html_element.rb', line 27 def html content_tag(tag_name, content, @html_options) end |