I have some questions on jquery in rails3. If I put a function like this in my application.js. Is it appropriate to put my JS in there rather than in my views?
$(function())
{
$("alert").onclick(function());
....
});
How do I call it within a view? Doesnt the function need an identifier or name? Is link_to_function a good way?