adding javascript/ controller snippet