-
-
Save wmoxam/c17f42b09ac646d15f03aabb70eaab79 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
<div class="layout"> | |
<div class="navigation"> | |
<%= render "src/views/_nav.ecr" %> | |
</div> | |
</div> | |
</body> | |
</html> |
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
equire "kemal" | |
require "./nav" | |
get "/" do | |
path = "/" | |
nav = Nav.new | |
nav.name = "root" | |
nav.css_class = "branch" | |
nav.path = "/names/root" | |
nav1 = Nav.new | |
nav1.name = "child1" | |
nav1.css_class = "branch" | |
nav1.path = "/names/root/child1" | |
nav2 = Nav.new | |
nav2.name = "child2" | |
nav2.css_class = "leaf" | |
nav2.path = "/names/root/child1/child2" | |
nav3 = Nav.new | |
nav3.name = "root" | |
nav3.css_class = "child3" | |
nav3.path = "/names/root/child3" | |
nav.children = [nav1, nav3] | |
nav1.children = [nav2] | |
render "src/views/index.ecr" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment