Why does trying to use Grape with Rails fail with “uninitialized constant API”?

前端 未结 3 411
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-16 04:21

I would like someone to explain why this is happening in Rails (4.1.8) with Grape (0.10.1)

so this is my API:

app/api/root.rb:

m         


        
3条回答
  •  旧巷少年郎
    2021-01-16 04:41

    I tried to put my files into app/api/api, but it wasn't working for me.

    I found a solution by simply putting the api folder into the controller folder. I'm not 100% sure what the problem was, but my guess is that it has something to do with the auto-loaded paths.

提交回复
热议问题