tutorials: article json

pull/3091/head
Alexander Medvednikov 2019-12-15 01:00:04 +03:00
parent 48ea136a9a
commit 5971aa7fef
2 changed files with 4 additions and 1 deletions

View File

@ -342,7 +342,7 @@ pub fn (app mut App) new_article() {
title := app.vweb.form['title']
text := app.vweb.form['text']
if title == '' || text == '' {
app.vweb.text('Empty text/titile')
app.vweb.text('Empty text/title')
return
}
article := Article{
@ -359,7 +359,10 @@ pub fn (app mut App) new_article() {
parameters via function arguments: `new_article(title, text string) {`.
We need to update `index.html` to add a link to the "new article" page:
```html
<a href='/new'>New article</a>
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB