Method: ActionFramework::ModelHelper.post
- Defined in:
- lib/actionframework/modelhelper.rb
.post(model, req, res) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/actionframework/modelhelper.rb', line 3 def self.post model,req,res if(model.create?) response = model.create(JSON.parse(req.body.read)).to_json res.body = [response] else error_403 res end res.finish end |