A clean pattern for calling javascript in Rails