shakacode / react-webpack-rails-tutorial

Example of integration of Rails, react, redux, using the react_on_rails gem, webpack, enabling the es7 and jsx transpilers, and node integration. And React Native! Live Demo:
http://www.reactrails.com
MIT License
1.72k stars 382 forks source link

Rails 7 Jbuilder ActionView::MissingTemplate Error #555

Open kohheepeace opened 1 year ago

kohheepeace commented 1 year ago

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

ahangarha commented 1 year ago

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.