aboutsummaryrefslogtreecommitdiffstats
path: root/lib/html_element.rb
diff options
context:
space:
mode:
authorsoykje2017-06-20 12:13:48 +0200
committerGitHub2017-06-20 12:13:48 +0200
commit11404ec5f9ae443f1a2de73dc491e07b3151f4c8 (patch)
treefa45ad5284384e913d4b764db5723ec3a1cc9c29 /lib/html_element.rb
parent041c6d8b732825dc8f84f3795e1fd63f0a30f483 (diff)
parent150e71e3110292c0c27fe35a63e8a2d0e26c5259 (diff)
downloadchouette-core-11404ec5f9ae443f1a2de73dc491e07b3151f4c8.tar.bz2
Merge pull request #22 from af83/3479-refactor-table_builder-helper
3479 refactor table builder helper
Diffstat (limited to 'lib/html_element.rb')
-rw-r--r--lib/html_element.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/html_element.rb b/lib/html_element.rb
new file mode 100644
index 000000000..469fd7565
--- /dev/null
+++ b/lib/html_element.rb
@@ -0,0 +1,15 @@
+class HTMLElement
+ def initialize(tag_name, content = nil, options = nil)
+ @tag_name = tag_name
+ @content = content
+ @options = options
+ end
+
+ def to_html(options = {})
+ ApplicationController.helpers.content_tag(
+ @tag_name,
+ @content,
+ @options.merge(options)
+ )
+ end
+end