Object
# File lib/merb-helpers/form/builder.rb, line 45 def bound_check_box(method, attrs = {}) name = control_name(method) update_bound_controls(method, attrs, "checkbox") unbound_check_box({:name => name}.merge(attrs)) end
# File lib/merb-helpers/form/builder.rb, line 73 def bound_radio_group(method, arr) val = control_value(method) arr.map do |attrs| attrs = {:value => attrs} unless attrs.is_a?(Hash) attrs[:checked] = true if (val == attrs[:value]) radio_group_item(method, attrs) end.join end
# File lib/merb-helpers/form/builder.rb, line 91 def bound_select(method, attrs = {}) name = control_name(method) update_bound_controls(method, attrs, "select") unbound_select({:name => name}.merge(attrs)) end
# File lib/merb-helpers/form/builder.rb, line 103 def bound_text_area(method, attrs = {}) name = "#{@name}[#{method}]" update_bound_controls(method, attrs, "text_area") unbound_text_area(control_value(method), {:name => name}.merge(attrs)) end
# File lib/merb-helpers/form/builder.rb, line 21 def fieldset(attrs, &blk) legend = (l_attr = attrs.delete(:legend)) ? tag(:legend, l_attr) : "" tag(:fieldset, legend + @origin.capture(&blk), attrs) # @origin.concat(contents, blk.binding) end
# File lib/merb-helpers/form/builder.rb, line 15 def form(attrs = {}, &blk) captured = @origin.capture(&blk) fake_method_tag = process_form_attrs(attrs) tag(:form, fake_method_tag + captured, attrs) end
# File lib/merb-helpers/form/builder.rb, line 119 def submit(value, attrs) attrs[:type] ||= "submit" attrs[:name] ||= "form_submit" attrs[:value] ||= value update_unbound_controls(attrs, "submit") self_closing_tag(:input, attrs) end
# File lib/merb-helpers/form/builder.rb, line 51 def unbound_check_box(attrs) update_unbound_controls(attrs, "checkbox") if attrs.delete(:boolean) on, off = attrs.delete(:on), attrs.delete(:off) unbound_hidden_field(:name => attrs[:name], :value => off) << self_closing_tag(:input, {:type => "checkbox", :value => on}.merge(attrs)) else self_closing_tag(:input, {:type => "checkbox"}.merge(attrs)) end end
# File lib/merb-helpers/form/builder.rb, line 82 def unbound_radio_group(arr, attrs = {}) arr.map do |ind_attrs| ind_attrs = {:value => ind_attrs} unless ind_attrs.is_a?(Hash) joined = attrs.merge(ind_attrs) joined.merge!(:label => joined[:label] || joined[:value]) unbound_radio_button(joined) end.join end
Generated with the Darkfish Rdoc Generator 2.