diff options
author | Clemens Kofler <clemens@railway.at> | 2009-03-17 14:46:19 +0100 |
---|---|---|
committer | Clemens Kofler <clemens@railway.at> | 2009-03-17 14:46:19 +0100 |
commit | d36df5e7a8a2791bb890afa0c11b8f3985293c21 (patch) | |
tree | 7bbe328d4e39e2b026303162c8268d1265bdc4e8 | |
parent | fc123d189c7394374af91a51efdcc756d3b11185 (diff) | |
download | rails-d36df5e7a8a2791bb890afa0c11b8f3985293c21.tar.gz rails-d36df5e7a8a2791bb890afa0c11b8f3985293c21.tar.bz2 rails-d36df5e7a8a2791bb890afa0c11b8f3985293c21.zip |
Hidden field with check box goes first.
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index a589bcba2a..93b8ae687f 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -657,17 +657,17 @@ module ActionView # ==== Examples # # Let's say that @post.validated? is 1: # check_box("post", "validated") - # # => <input type="checkbox" id="post_validated" name="post[validated]" value="1" /> - # # <input name="post[validated]" type="hidden" value="0" /> + # # => <input name="post[validated]" type="hidden" value="0" /> + # # <input type="checkbox" id="post_validated" name="post[validated]" value="1" /> # # # Let's say that @puppy.gooddog is "no": # check_box("puppy", "gooddog", {}, "yes", "no") - # # => <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog]" value="yes" /> - # # <input name="puppy[gooddog]" type="hidden" value="no" /> + # # => <input name="puppy[gooddog]" type="hidden" value="no" /> + # # <input type="checkbox" id="puppy_gooddog" name="puppy[gooddog]" value="yes" /> # # check_box("eula", "accepted", { :class => 'eula_check' }, "yes", "no") - # # => <input type="checkbox" class="eula_check" id="eula_accepted" name="eula[accepted]" value="yes" /> - # # <input name="eula[accepted]" type="hidden" value="no" /> + # # => <input name="eula[accepted]" type="hidden" value="no" /> + # # <input type="checkbox" class="eula_check" id="eula_accepted" name="eula[accepted]" value="yes" /> # def check_box(object_name, method, options = {}, checked_value = "1", unchecked_value = "0") InstanceTag.new(object_name, method, self, options.delete(:object)).to_check_box_tag(options, checked_value, unchecked_value) |