Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

allow for redirects in actions using a path helper #1020

Merged
merged 2 commits into from
Apr 10, 2018
Merged

Conversation

markbates
Copy link
Member

@markbates markbates commented Apr 10, 2018

return c.Redirect(302, "widgetPath()", render.Data{"widget_id": widget.ID})
// or
return c.Redirect(302, "widgetPath()", map[string]interface{}{"widget_id": widget.ID})

Replaces PR #622

```go
return c.Redirect(302, "widgetPath", render.Data{"widget_id": widget.ID})
// or
return c.Redirect(302, "widgetPath", map[string]interface{}{"widget_id": widget.ID})
```
@paganotoni
Copy link
Member

paganotoni commented Apr 10, 2018

This may be too late but what about something like:

return c.Redirect(302, "widgetPath", widget.ID)
return c.Redirect(302, "userWidgetPath", user.ID,  widget.ID)

@markbates markbates merged commit 2461470 into development Apr 10, 2018
@markbates markbates deleted the return-route branch April 10, 2018 21:10
stanislas-m pushed a commit that referenced this pull request May 12, 2018
* allow for redirects in actions using a path helper

```go
return c.Redirect(302, "widgetPath", render.Data{"widget_id": widget.ID})
// or
return c.Redirect(302, "widgetPath", map[string]interface{}{"widget_id": widget.ID})
```

* changed to using `rootPath()` as the string instead of `rootPath`
lukasschlueter added a commit to lukasschlueter/gobuffalo that referenced this pull request Oct 8, 2018
lukasschlueter added a commit to lukasschlueter/gobuffalo that referenced this pull request Oct 8, 2018
stanislas-m pushed a commit to gobuffalo/docs that referenced this pull request Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants