-
-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22a71a3
commit 3989ca1
Showing
3 changed files
with
9 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
# frozen_string_literal: true | ||
module Arbre | ||
class Component < Arbre::HTML::Div | ||
|
||
# By default components render a div | ||
def tag_name | ||
'div' | ||
end | ||
|
||
def initialize(*) | ||
super | ||
add_class default_class_name | ||
end | ||
|
||
protected | ||
|
||
# By default, add a css class named after the ruby class | ||
def default_class_name | ||
self.class.name.demodulize.underscore | ||
end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters