¿Jquery no funciona en la aplicación Rails 3.2?
Tratando de obtener un simple show / hide en marcha. Está funcionando en js fiddle, simplemente no en mi aplicación.
En mis vistas / user_steps / interests.html.erb
<code><label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="2" /> Valentine Day </label> <div style="display:none;"> Whatever you have to capture here<input type="text" id="foo" /> </div> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="3" /> Easter </label> <div style="display:none;"> Whatever you have to capture here<input type="text" id="foo1" /> </div> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="4" /> Mother Day </label> <div style="display:none;"> Whatever you have to capture here<input type="text" id="foo2" /> </div> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="5" /> Father's Day </label> <div style="display:none;"> Whatever you have to capture here<input type="text" id="foo3" /> </div> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="6" /> Halloween </label> <div style="display:none;"> Whatever you have to capture here<input type="text" id="foo4" /> </div> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="7" /> Thanksgiving </label> </br> <label class="checkbox"> <input id="user_holiday_ids_" name="user[holiday_ids][]" type="checkbox" value="8" /> Christmas </label> </code>
En mis activos / javascripts / user_steps.js:
<code>$(".checkbox").click(function(){ $(this).next("div").toggle(); }); </code>