I have a react-rails project (ES5) in which I am trying to render a form from a _form.html.erb file in a React Component.js.jsx ... and I am really lost on how to approach this situation, if it is even possible. There are many forms in my project, but all are being rendered the traditional <%= render "samples/new_sample_form" %>
way in my html.erb views. However, now I am inside a React component and am trying to pull my Rails form into the js.jsx file. I have tried creating a variable var sampleForm = "<%= render 'samples/new_sample_form' %>"
but that is not working, only giving me the pathway as text and not doing anything.
So - is it possible to do what I am trying and if so... how? Thanks.
Code in js.jsx -> var taskForm = "<%= render 'tasks/new_task_form' %>"
-> My result