rails / jbuilder

Jbuilder: generate JSON objects with a Builder-style DSL
MIT License
4.34k stars 440 forks source link

API scaffold generator doesn't reference jbuilder partials correctly when namespaced #474

Closed joshleblanc closed 2 years ago

joshleblanc commented 4 years ago

Steps to reproduce

  1. Create a new rails project
  2. Run rails generate scaffold api/user email:uniq password:digest --api
  3. Look at app/views/api/users/index.json.jbuilder, it references api_users/api_user, not api/users/api_user

Expected behavior

The partial references should be api/users/api_user

Actual behaviora

The partial referenced is api_users/api_user, which doesn't exist.

System configuration

Rails version: Rails 6.0.1

Ruby version: ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]

robin850 commented 4 years ago

(Cross-refs #492)