htranho
(Hoan-Vu Tran-Ho)
April 25, 2024, 7:55pm
1
This works in Rails 6.1 but not in 7.0:
Error message:
Missing partial reports/_ingest_chart.js, application/_ingest_chart.js with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:raw, :erb, :html, :builder, :ruby, :coffee, :jbuilder]}.
code:
…script type=“text/javascript”>
<%= render partial: ‘ingest_chart.js’ %>
File is reports/_ingest_chart.js.erb
dcunning
(Dan Cunning)
April 25, 2024, 9:08pm
2
Note :formats=>[:html]
in the error message. Since you’re responding to an HTML request, it’s looking for HTML templates. To override this default, your render call can do this:
<%= render partial: ‘ingest_chart’, formats: [:js] %>
1 Like
htranho
(Hoan-Vu Tran-Ho)
April 25, 2024, 9:55pm
3
Thanks a lot, that works.