shakacode/react-webpack-rails-tutorial

Rails 7 Jbuilder ActionView::MissingTemplate Error

kohheepeace opened this issue · 1 comments

Problem

In Rails 7, I got an "ActionView::MissingTemplate Error" error when I try to use jbuilder as described in the following document.

https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/docs/jbuilder.md

Solution

❌ Not working

<%= react_component('App', props: render(template: "/comments/index.json.jbuilder")) %>

✅ Working

<%= react_component('App', props: render(template: "/comments/index", formats: :json)) %>

Ref

https://stackoverflow.com/a/74683089/6037441

Sorry for this, but this document seems outdated.
I will take a look at the issue and docs in a couple of days and will let you know the result.

Thanks for your report.