Closed r3ap3r2004 closed 2 years ago
Same here. I had similar issue.
But after changing the method parameter type from plush.HelperContext to hctx.HelperContext resolved this problem
PS: I found this after digging into default helpers (i.e forms.Form)
@markbates Please confirm if the above is the expected signature so that I can send a pull request to update the documentation accordingly.
Thanks.
I had the same problem and error message: reflect: Call using plush.HelperContext as type plush.HelperContext
.
I resolved it by changing the import for github.com/gobuffalo/plush
to github.com/gobuffalo/plush/v4
.
See https://github.com/OpenPeeDeeP/depguard/issues/9#issuecomment-657441364 for a hint, on how these situations can be detected by the depguard linter (also included in golangci-lint).
It seems like this question has a helpful answer. I am closing it.
Custom block helpers are not working for me. I am following the documentation found here: https://gobuffalo.io/en/docs/custom-helpers/#block-helpers
If I try the exact block helper example shown in the document I get the following compile error:
the original helper code
That is obviously caused by a bug in the example code where it is expecting a
template.HTML
response, but the example code is only returning a plain string. So I changed the upblock function to return a string instead, but now I get the following error:Any idea what is going wrong? I have also tried the reverse of leaving the return value as
template.HTML
and converting the output to use a buffalo tag, but that still has the same error.My code looks like this:
render.go
index.plush.html
go.mod
go version