comparison examples/blog/src/new.luan @ 1152:21d157b153fe

change http parameters interface
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 04 Feb 2018 19:25:12 -0700
parents c38f6619feb9
children 5dbb552075ff
comparison
equal deleted inserted replaced
1151:dbb3cb906482 1152:21d157b153fe
4 local Http = require "luan:http/Http.luan" 4 local Http = require "luan:http/Http.luan"
5 local Post = require "site:/lib/Post.luan" 5 local Post = require "site:/lib/Post.luan"
6 6
7 7
8 return function() 8 return function()
9 local subject = Http.request.parameter.subject 9 local subject = Http.request.parameters.subject
10 local content = Http.request.parameter.content 10 local content = Http.request.parameters.content
11 if Http.request.parameter.save ~= nil then 11 if Http.request.parameters.save ~= nil then
12 local post = Post.new{ subject=subject, content=content } 12 local post = Post.new{ subject=subject, content=content }
13 post.save() 13 post.save()
14 Http.response.send_redirect("/") 14 Http.response.send_redirect("/")
15 return 15 return
16 end 16 end