-1
/行く隠す...そのjsのフィドルでの作業だけでなく、私のアプリで...私の資産には、私の見解/ user_stepsでJailはレール3.2のアプリケーションで動作していませんか?シンプルなショーを取得しよう
/interests.html.erb
<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>
/javascripts/user_steps.js:
$(".checkbox").click(function(){
$(this).next("div").toggle();
});
エラーコンソールにエラーはありますか? – icktoofay
多くの重複IDが問題です。 – Marc
hiya、申し訳ありませんが、<2 mins back>はこれと同じ質問ではありません:http://stackoverflow.com/questions/10561210/how-to-show-hide-in-rails-form-with-jquery/? –