Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- checkbox_control :is_searchable, :label => "Allow other #{SITE_NAME} members to search for me and view me on the members page?"
- # Generates this:
- <input type="checkbox" id="user_is_searchable" value="1" name="user[is_searchable]" class="checkbox" checked="checked"/>
- <input type="hidden" value="0" name="user[is_searchable]" class="hidden"/>
- <label for="user_is_searchable">Send me weekly motivator reports?</label>
- # When this is submitted to the controller I get:
- { "user" => { "is_searchable" => "0" } }
- # Even if the checkbox is checked?
- # I can solve this by simply reversing the order of the hidden checkbox field. Like so:
- <input type="hidden" value="0" name="user[is_searchable]" class="hidden"/>
- <input type="checkbox" id="user_is_searchable" value="1" name="user[is_searchable]" class="checkbox" checked="checked"/>
- <label for="user_is_searchable">Send me weekly motivator reports?</label>
Add Comment
Please, Sign In to add comment