Skip to content

Instantly share code, notes, and snippets.

@DanielTimLee
Last active October 13, 2016 13:26
Show Gist options
  • Save DanielTimLee/8038916dfc26b2e05564a5941b1b021b to your computer and use it in GitHub Desktop.
Save DanielTimLee/8038916dfc26b2e05564a5941b1b021b to your computer and use it in GitHub Desktop.
type Wiki struct {
Id int
Title string `sql:"type varchar(300)"`
Description string `sql:"type varchar(300)"`
}
@kyoodong
Copy link

func (c App) Search(keyword string) revel.Result {
    wiki := readWiki()
    // c.RenderArgs["title"] = wiki.Title
    // c.RenderArgs["description"] = wiki.Description
    return c.Render(wiki)
}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Hi</title>
</head>
<body>
{{ .Title }}
{{ .Description }}
</body>
</html>

html에서 .Title 이런식으로 접근하고 싶어서 코드를 짜 봤는데 잘 안됩니다.
readWiki()로 dummyData 가져오는데까지는 성공했습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment