On The Route

Create a route


get "/user" do
  name = "joe"
  render "src/views/pages/user.ecr", "src/views/layouts/main.ecr"

Render Method

Macro Value1 value2 Detail
render src/views/hello.ecr src/views/layouts/main.ecr you pass down the ecr view that you want to render on that route and layout page
view location layout location

On The View

Just put the code you want to show up for that view


<div class="content-area">
  Hey, here goes my html

Use <%= content %> tag to display the page content on the layout

On The Layout


  <title>My Kemal Application</title>
    <ul class="menu">
      <li><a href="#">Home</a></li>
      <li><a href="#">Contact</a></li>
  <%= content %>

results matching ""

    No results matching ""