ruby on rails - Render partial inside a javascript variable -
I am using Rail 3.2, and 3.2 using Bootstrap and partially shown in a bootbox control. Being, but not luck.
bootbox.dialog ({title: "new appointment", message: '& lt;% = (render "form_remote")%>,
The problem is that it presents new lines, and the script breaks the code. This is the generated code:
bootbox.dialog ({title: "new appointment", message: 'Div class = "row"> div class = "col-xs-12 col-sm-6" & gt; label class = "" = "person_id"> Numeron <;> & lt; input class = "form-control" id = "person_id" type = "text" & gt; & lt; / div & gt; & lt; / div & gt; & Lt; / div & gt; ',
To work for now, I I repeat partly in one line ...
Is there another way to do all this?
Use, example:
bootbox.dialog ({title: "new appointment", message: '& lt;% = escape_javascript (render "form_remote") % & Gt; ',
Comments
Post a Comment