I would recommend *not* having a bunch of javascript code in your erb files.