Rob Lacey wrote in post #949724: > On 13 October 2010 03:15, Marnen Laibow-Koser <[email protected]> > wrote: >>> >>> #JS >>> $("some_div").update("<%= escape_javascript(render('some_partial')) >>> %>"); >> >> Well, you should never ever be writing ERb in your JavaScript like that. >> JS files should IMHO always be static. > > > I've been looking at making a very JS heavy interface of late and it > actually requires replacing sections of the page with dynamic content. > Your take on it suggests that you could only ever return a static js > script, and therefore have no dynamic content. Is that right?
Not at all. You can have dynamic content with static JS files (search the list archives for more info -- I go through this discussion every couple of weeks :) ). My usual method is to have the JS read a hidden element that Rails puts in the DOM. Best, -- Marnen Laibow-Koser http://www.marnen.org [email protected] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

