Permalink
Browse files

have select_control use database value as the default selected value

Signed-off-by: Michael D. Ivey <ivey@gweezlebur.com>
  • Loading branch information...
1 parent adb8dc7 commit 969f44bd2efd5c8af26aa7a93a24e63711073d0b @brijohn brijohn committed with ivey Feb 29, 2008
Showing with 1 addition and 0 deletions.
  1. +1 −0 merb_helpers/lib/merb_helpers/form_helpers.rb
@@ -402,6 +402,7 @@ def select_field(attrs = {})
def select_control(col, attrs = {})
attrs.merge!(:name => attrs[:name] || control_name(col))
attrs.merge!(:id => attrs[:id] || control_id(col))
+ attrs.merge!(:selected => attrs[:selected] || control_value(col))
errorify_field(attrs, col)
optional_label(attrs) { select_field(attrs) }
end

0 comments on commit 969f44b

Please sign in to comment.