On Aug 7, 2012, at 9:43 AM, Manish Nautiyal wrote:

> That is a .js file.

And so, if you want it to also include interpolation, using erb syntax, you 
have to tack .erb to the end of the filename, and you have to put the file in a 
location where it will be interpreted (hint: not in /public/javascripts). 

But step back and think if there's another way to write your JavaScript so you 
don't need that interpolation. Can you write that variable data into the 
partial for /org_pages? The reason you would want to do that is so that the 
JavaScript can be compressed and minified along with all the other static 
assets. The moment you start generating your JavaScript dynamically, you force 
the browser to re-load it from scratch each page load, along with all the HTML. 
Your Ajax call is already creating a dynamic snippet of HTML -- what's a little 
more HTML there?

Walter

> 
> -- 
> 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 rubyonrails-talk@googlegroups.com.
> To unsubscribe from this group, send email to 
> rubyonrails-talk+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to