fixtures/layout.rb
Lines
11%2 of 17 covered
Branches
—0 of 0 covered
Methods
0%0 of 2 covered
- Not run
- 5-69-1417-2226
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 2 | module Example |
| 4 | 2 | class LayoutComponent < Phlex::HTML |
| 5 | 0 | def initialize(title: "Example") |
| 6 | 0 | @title = title |
| 7 | end | |
| 8 | ||
| 9 | 0 | def view_template(&block) |
| 10 | 0 | html do |
| 11 | 0 | head do |
| 12 | 0 | title { @title } |
| 13 | 0 | meta name: "viewport", content: "width=device-width,initial-scale=1" |
| 14 | 0 | link href: "/assets/tailwind.css", rel: "stylesheet" |
| 15 | end | |
| 16 | ||
| 17 | 0 | body class: "bg-zinc-100" do |
| 18 | 0 | nav class: "p-5", id: "main_nav" do |
| 19 | 0 | ul do |
| 20 | 0 | li(class: "p-5") { a(href: "/") { "Home" } } |
| 21 | 0 | li(class: "p-5") { a(href: "/about") { "About" } } |
| 22 | 0 | li(class: "p-5") { a(href: "/contact") { "Contact" } } |
| 23 | end | |
| 24 | end | |
| 25 | ||
| 26 | 0 | div class: "container mx-auto p-5", &block |
| 27 | end | |
| 28 | end | |
| 29 | end | |
| 30 | end | |
| 31 | end |