gobuffalo / buffalo

Rapid Web Development w/ Go
http://gobuffalo.io
MIT License
8.08k stars 579 forks source link

bug: wrong template string in partialFeeder under Windows #2371

Closed RushZeit closed 1 year ago

RushZeit commented 1 year ago

Description

Description

The function func (s *templateRenderer) partialFeeder(name string) (string, error), returns template string for the name. But the convertion changed path separator from unix-like style "/" to Windows-like style "\". See: filepath.Join(d, "_"+f)

How to fix: name = filepath.ToSlash(filepath.Join(d, "_"+f))

Expected Behavior

The partial plush template should be found under Windows.

Actual Behavior

The partial template can not be found under Windows.

To Reproduce

go v. 1.19.3

use partial plush template path with slash

For example: <%= formFor(subscriptionPlan, {action: subscriptionPlansPath(), method: "POST"}) { %> <%= partial("subscription_plans/form.html") %> <%= linkTo(subscriptionPlansPath(), {class: "btn btn-warning", "data-confirm": "Are you sure?", body: "Cancel"}) %> <% } %>

Additional Context

Details

``` Paste the output of `buffalo info` here! ```
saurori commented 1 year ago

Same issue? https://github.com/gobuffalo/buffalo/issues/2370

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

saurori commented 1 year ago

Still relevant

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 30+7 days with no activity.