더북(TheBook)

Flash 메시지를 보여주도록 헤더 템플릿 수정

revel new goblog 명령을 통해 자동으로 생성된 웹 애플리케이션의 헤더 템플릿에는 Flash 메시지를 보여주는 부분이 없다. Flash 메시지를 보여주려면 헤더 템플릿을 수정해야 한다.

▼ app/views/header.html

<!DOCTYPE html>
 
<html>
    <head>
        <title>{{.title}}</title>
        <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”>
        <link rel=“stylesheet” type=“text/css” href=”/public/css/bootstrap.css”>
        <link rel=“shortcut icon” type=“image/png” href=”/public/img/favicon.png”>
        <script src=”/public/js/jquery-1.9.1.min.js” type=“text/javascript” charset=“utf-8”></script>
        {{range .moreStyles}}
            <link rel=“stylesheet” type=“text/css” href=”/public/{{.}}”>
        {{end}}
        {{range .moreScripts}}
            <script src=”/public/{{.}}” type=“text/javascript” charset=“utf-8”></script>
        {{end}}
    </head>
    <body>
    {{template “flash.html” .}}

신간 소식 구독하기
뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.