Skip to content

Commit 9d414e5

Browse files
committed
chore(views): improve ErrorPage css_class conversion
Examples: - PageNotFound => page_not_found - PageNotAllowed => page_not_allowed - RecordNotFound => record_not_found - ErrorPage => error_page - HTMLError => html_error - MyXMLParser => my_xml_parser
1 parent f5efb45 commit 9d414e5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/tiny_admin/views/pages/error_page.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def view_template
1616

1717
def css_class
1818
self.class.name.split("::").last
19-
.gsub(/([A-Z])/, '_\1')
20-
.sub(/^_/, "")
19+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
20+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
2121
.downcase
2222
end
2323
end

0 commit comments

Comments
 (0)