.js.erb VS .js
.js.erb files are for controller actions, such as create, when you want javascript to be executed when the action completes. For example, when you want to submit a form via ajax and want display an alert when everything is done, you would put the $(‘#business_submit’).click(…) in your application.js or *.html.erb, and your create.js.erb could look … Read more