Skip to content

Commit

Permalink
viewsss
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromorgan committed Mar 12, 2017
1 parent c0220f9 commit 0e454f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions controller.go
Expand Up @@ -36,7 +36,7 @@ type Controller struct {
Session Session // Session, stored in cookie, signed.
Params *Params // Parameters from URL and form (including multipart).
Args map[string]interface{} // Per-request scratch space.
RenderArgs map[string]interface{} // Args passed to the template.
ViewArgs map[string]interface{} // Variables passed to the template.
Validation *Validation // Data validation helpers
}

Expand All @@ -47,7 +47,7 @@ func NewController(req *Request, resp *Response) *Controller {
Response: resp,
Params: new(Params),
Args: map[string]interface{}{},
RenderArgs: map[string]interface{}{
ViewArgs: map[string]interface{}{
"RunMode": RunMode,
"DevMode": DevMode,
},
Expand All @@ -69,7 +69,7 @@ func (c *Controller) SetCookie(cookie *http.Cookie) {
func (c *Controller) RenderError(err error) Result {
c.setStatusIfNil(http.StatusInternalServerError)

return ErrorResult{c.RenderArgs, err}
return ErrorResult{c.ViewArgs, err}
}

func (c *Controller) setStatusIfNil(status int) {
Expand Down
2 changes: 1 addition & 1 deletion validation.go
Expand Up @@ -195,7 +195,7 @@ func ValidationFilter(c *Controller, fc []Filter) {
fc[0](c, fc[1:])

// Add Validation errors to RenderArgs.
c.RenderArgs["errors"] = c.Validation.ErrorMap()
c.ViewArgs["errors"] = c.Validation.ErrorMap()

// Store the Validation errors
var errorsValue string
Expand Down

0 comments on commit 0e454f2

Please sign in to comment.