gobuffalo / buffalo

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

index/show pages fail with resource named 'post' #1199

Closed JM00oo closed 6 years ago

JM00oo commented 6 years ago

Steps to Reproduce the Problem

  1. $ buffalo new demo && cd demo
  2. setup database.yml
  3. $ buffalo g r post title content
  4. $ buffalo db migrate
  5. $ buffalo dev
  6. go to localhost:3000 and create a post

Expected Behavior

I expect it will redirect to http://localhost:3000/posts/{post_id} and show the post I created.

Actual Behavior

I got 500 - ERROR! page saying: posts/show.html: line 7: editPOSTPath: unknown identifier .... And I found that replacing editPOSTPath with editPostPath in template/post/index.html and template/post/show.html can fix this issue.

Info

``` ### Buffalo Version v0.12.4 ### App Information Pwd=/Users/jm-istaging/go/src/github.com/JM/demo Root=/Users/jm-istaging/go/src/github.com/JM/demo GoPath=/Users/jm-istaging/go Name=demo Bin=bin/demo PackagePkg=github.com/JM/demo ActionsPkg=github.com/JM/demo/actions ModelsPkg=github.com/JM/demo/models GriftsPkg=github.com/JM/demo/grifts VCS=git WithPop=true WithSQLite=false WithDep=false WithWebpack=true WithYarn=true WithDocker=true WithGrifts=true ### Go Version go version go1.10 darwin/amd64 ### Go Env GOARCH="amd64" GOBIN="" GOCACHE="/Users/jm-istaging/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/jm-istaging/go" GORACE="" GOROOT="/usr/local/go" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9b/mqpmvw2j6mn6xbg397grxq0c0000gn/T/go-build085141574=/tmp/go-build -gno-record-gcc-switches -fno-common" ### Node Version v8.9.4 ### NPM Version 5.6.0 ### Yarn Version 1.3.2 ### PostgreSQL Version PostgreSQL Not Found ### MySQL Version mysql Ver 14.14 Distrib 5.7.18, for osx10.12 (x86_64) using EditLine wrapper ### SQLite Version 3.19.4 2017-08-18 19:28:12 605907e73adb4533b12d22be8422f17a8dc125b5c37bb391756a11fc3a8c4d10 ### Dep Version could not find a Gopkg.toml file ### Dep Status could not find a Gopkg.toml file ```
mclark4386 commented 6 years ago

This seems to be an issue with https://github.com/markbates/inflect/blob/master/inflect.go#L19 marking all instants of "post" as the acronym POST... not positive what the best way to move forward would be... @markbates what do you think?

markbates commented 6 years ago

That was my guess, but I’m traveling today, so I can’t look into it, but i know it probably shouldn’t. lol

-- Mark Bates On Jul 26, 2018, 9:26 AM +0200, Matthew Clark notifications@github.com, wrote:

This seems to be an issue with https://github.com/markbates/inflect/blob/master/inflect.go#L19 marking all instants of "post" as the acronym POST... not positive what the best way to move forward would be... @markbates what do you think? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JM00oo commented 6 years ago

So do you have any idea to fix it? I would like to fix it, but I am not sure how to do it.