Rails 4 - Conditional JS with dependent-fields-rails
问题 I'm trying to figure out how to use dependent-fields-rails gem with my Rails 4 app. I'm lost. I have included underscore.js in my vendor javascripts folder and updated my application.js to include (right at the bottom, just above require tree): //= require underscore //= require dependent-fields $(document).ready(function() { DependentFields.bind() }); In my simple form, I have: <%= f.input :has_milestones, as: :boolean, boolean_style: :inline, :label => 'Any decision points?', id: 'check