-
Notifications
You must be signed in to change notification settings - Fork 440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails g scaffold for module resource generates wrong directory in jbuilder templates. #379
Comments
I just ran into this, looking to submit test + patches soon. System configuration: Rails version: 5.0.1 Ruby version: 2.3.1 Basically, using jbuilder from the rails point of view (rails 5.0.0 in For example in my
...which breaks the app, since, for example, the partial really is in
This also affects the other locations that @rafaelfranca mentioned. Changing the view code from
|
Done, let me know if this works for you guys 😄 |
Looks fine, thanks. |
From @jung-hunsoo on January 30, 2017 10:9
Steps to reproduce
$ rails g scaffold guest/category title description
Expected behavior
While many new files being generated, three jbuilder templates are expected to be created like this:
_guest_category.json.jbuilder
json.extract! guest_category, :id, :title, :description, :created_at, :updated_at
json.url guest_category_url(guest_category, format: :json)
index.json.jbuilder
json.array! @guest_categories, partial: 'guest/categories/guest_category', as: :guest_category
show.json.jbuilder
json.partial! "guest/categories/guest_category", guest_category: @guest_category
Actual behavior
The two jbuilder templates for index and show have inexistent directory which the module namespace isn't applied.
_guest_category.json.jbuilder
json.extract! guest_category, :id, :title, :description, :created_at, :updated_at
json.url guest_category_url(guest_category, format: :json)
index.json.jbuilder
json.array! @guest_categories, partial: 'guest_categories/guest_category', as: :guest_category
show.json.jbuilder
json.partial! "guest_categories/guest_category", guest_category: @guest_category
System configuration
Rails version: 5.0.1
Ruby version: 2.3.3
Copied from original issue: rails/rails#27845
The text was updated successfully, but these errors were encountered: