public
Description: Merb Plugins: Even more modules to hook up your Merb installation
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-plugins.git
Fixes checkbox_control always submitting the "off" value. Resolves ticket #145. 
Thanks Bryan Ray!
Michael Sheakoski (author)
Sun Aug 17 16:12:41 -0700 2008
commit  cc6461712b42bf724c53380c35435f9ff9df9287
tree    e57e00a1f72211b36a83f79c7a956508102f4a8f
parent  e59f95661e2441d12f966da81e53c51558a04d5d
...
167
168
169
170
171
 
 
172
173
174
...
167
168
169
 
 
170
171
172
173
174
0
@@ -167,8 +167,8 @@ module Merb::Helpers::Form::Builder
0
       update_fields(attrs, "checkbox")
0
       if attrs.delete(:boolean)
0
         on, off = attrs.delete(:on), attrs.delete(:off)
0
-        self_closing_tag(:input, {:type => "checkbox", :value => on}.merge(attrs)) <<
0
-          hidden_field(:name => attrs[:name], :value => off)
0
+        hidden_field(:name => attrs[:name], :value => off) <<
0
+          self_closing_tag(:input, {:type => "checkbox", :value => on}.merge(attrs))
0
       else
0
         self_closing_tag(:input, {:type => "checkbox"}.merge(attrs))
0
       end

Comments