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

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -