Rails 4 では、.JS ビューで Ruby コードを使用できますか? Rails 3 では、ファイル名に .erb.js を含める必要がありました
def test
respond_to do |format|
format.js { Rails.logger.info "in JS handler" }
end
end
/app/views/users/test.erb.js <== no longer works in rails 4
と
/app/views/users/test.js <== still works in rails 4 but does it allow ruby inside this file?