Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post an array of struct #1079

Closed
hyacinthxinxin opened this issue Jul 2, 2016 · 1 comment
Closed

post an array of struct #1079

hyacinthxinxin opened this issue Jul 2, 2016 · 1 comment
Labels
type-support not actionable, recommend StackOverflow

Comments

@hyacinthxinxin
Copy link

I define a type of cam in my models

type Cam struct {
    CamId           bson.ObjectId `bson:"_id,omitempty"`
    CamName         string        `CamName`
    CreatedTime     time.Time     `CreatedTime,omitempty`
    UpdatedTime     time.Time     `UpdatedTime,omitempty`
}

and the controller function is

func (c Device) AddCam(cams []models.Cam) revel.Result {
    for _, cam := range cams {
        LogJ(cam)
    }
    return c.RenderJson("Success")
}

how could I post my data with js.

@pedromorgan
Copy link
Member

Please refer the "binder" in the manual

http://revel.github.io/manual/parameters.html

@jeevatkm jeevatkm added the type-support not actionable, recommend StackOverflow label Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-support not actionable, recommend StackOverflow
Projects
None yet
Development

No branches or pull requests

3 participants