Converted from Rails app to pure JS/Coffee.