Jian Lin wrote: > In Ruby on Rails, if a partial (such as _msgbox.html.erb) need to use > Javascript by > > javascript_include_tag :defaults > > but then, the page layout or other view may also have that same line, so > the same javascript files will be included multiple time? > > Is there a way to tell Rails just to include it at most once? kind of > like the PHP ways of require_once or include_once
You needn't worry about this. The browser's caching mechanism should ensure that the file is only fetched once. 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.

