How to use a $var in escape_javascript

Hi All,

A question on using javascript within a view to render a partial. Been
struggling wit this for a bit.
I’ve multiple partials in my views and I want to replace them within a
specific div, how do I get this variable ‘page’ within the
escape_javascript and replace it with ‘reviews’ so I can render the
other pages (Such as specials, gallery, etc) within that div.

Thanks. Appreciate the help!
Below is the code snippet.

On Feb 1, 5:01am, “Anush J.” [email protected] wrote:

Below is the code snippet.
You can’t - the call to escape_javascript happens server side, whereas
the value of page will only be known client side, at the point where
the user clicks on something. You could load the content via ajax

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs