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