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

route helper not working with patial with extra arguments #1044

Closed
sio4 opened this issue Apr 24, 2018 · 1 comment
Closed

route helper not working with patial with extra arguments #1044

sio4 opened this issue Apr 24, 2018 · 1 comment
Milestone

Comments

@sio4
Copy link
Member

sio4 commented Apr 24, 2018

Hello, If I send additional contexts to partial by optional argument, something went wrong. In my case, route helpers are not working.

What I understand from URL below is, "local" variables can be passed to partial but at this time, it is additional variable or override existing variable, but also existing contexts of parent are passed with it.

https://gobuffalo.io/en/docs/partials

In addition to have the context of the parent template, partials can also be sent additional information as "local" variables.

Steps to Reproduce the Problem

Following partial is used for test:

<%= loginPath() %>

From caller side, working version is like this:

<%= partial("login.html") %>

It shows /login as expected.

But if I call this partial with

<%= partial("login.html", {users: resource.Users}) %>

It makes error

loginPath: unknown identifier

I am using buffalo 0.11.0.

markbates added a commit that referenced this issue May 1, 2018
* make sure to merge partial args and the context. fixes #1044. fixes #1006

* adds the environment flag as a build tag when building bins
@markbates markbates added this to the 0.11.1 milestone May 1, 2018
@markbates
Copy link
Member

Fixed with #1045

stanislas-m pushed a commit that referenced this issue May 12, 2018
* make sure to merge partial args and the context. fixes #1044. fixes #1006

* adds the environment flag as a build tag when building bins
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants