I like to keep my javascript out of views if possible, but I've found that difficult in certain situations.
Say I have a video partial that has corresponding javascript (using jplayer):
_video.haml
.video
content_for :javascript/head
/ jplayer instance code here
One alternative I've thought is to hook into .video from within a separate js file and instantiate jplayer objects via that.
videos.coffee
$('.video').each
# jplayer instance code here
My question is, what about pages where '.video' isn't found? Will it cause problems if I have lots of jquery finders that are missing?