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?