mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
tutorials: fix index() (#5732)
This commit is contained in:
parent
246e7e8464
commit
317b2dc579
4 changed files with 9 additions and 8 deletions
1
tutorials/code/blog/.gitignore
vendored
Normal file
1
tutorials/code/blog/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
blog.db
|
|
@ -1,4 +1,4 @@
|
|||
drop table Article;
|
||||
drop table if exists Article;
|
||||
|
||||
create table Article (
|
||||
id integer primary key,
|
||||
|
|
|
@ -16,18 +16,18 @@ fn main() {
|
|||
}
|
||||
|
||||
/*
|
||||
fn (mut app App) index_text() vweb.Result {
|
||||
pub fn (mut app App) index_text() vweb.Result {
|
||||
app.vweb.text('Hello, world from vweb!')
|
||||
return vweb.Result{}
|
||||
}
|
||||
|
||||
fn (app &App) index_html() vweb.Result {
|
||||
pub fn (app &App) index_html() vweb.Result {
|
||||
message := 'Hello, world from Vweb!'
|
||||
return $vweb.html()
|
||||
}
|
||||
*/
|
||||
|
||||
fn (app &App) index() vweb.Result {
|
||||
pub fn (app &App) index() vweb.Result {
|
||||
articles := app.find_all_articles()
|
||||
return $vweb.html()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue