moving widget js to rails