lib/merb/mixins/form_control_mixin.rb in merb-0.3.1 vs lib/merb/mixins/form_control_mixin.rb in merb-0.3.3
- old
+ new
@@ -39,9 +39,14 @@
def number(o)
o.value ||= 0
text(o)
end
+ def hidden(o)
+ o.value ||= ""
+ %{<input type="hidden" name="#{o.name}" value="#{o.value}" #{o.html ? o.html.map{|k,v| "#{k}=\"#{v}\""}.join(' ') : nil}/>}
+ end
+
def text(o)
o.value ||= ""
tag = ''
tag << "#{o.title}: " if o.title
tag << %{<input type="text" name="#{o.name}" value="#{o.value}" #{o.html ? o.html.map{|k,v| "#{k}=\"#{v}\""}.join(' ') : nil}/>}
\ No newline at end of file