From ff03e98b152a7f66f090779a36b44f459671dd8d Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Mon, 13 Jul 2009 23:14:53 -0400 Subject: [PATCH] SF update --- vendor/plugins/semi_formal/lib/semi_formal.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vendor/plugins/semi_formal/lib/semi_formal.rb b/vendor/plugins/semi_formal/lib/semi_formal.rb index cff3071..a57c41c 100644 --- a/vendor/plugins/semi_formal/lib/semi_formal.rb +++ b/vendor/plugins/semi_formal/lib/semi_formal.rb @@ -47,15 +47,17 @@ class SemiFormal < ActionView::Helpers::FormBuilder # returns a drop-down with value of User#id, text of User#to_s # includes blank # - def belongs_to(field, *args) + def belongs_to(association, *args) options = args.extract_options! - reflection = @object.class.reflect_on_association(field) + reflection = @object.class.reflect_on_association(association) collection = reflection.klass.all.collect {|each| [each.to_s, each.id] } options[:select] ||= {} options[:select][:include_blank] = true + field = "#{association}_id" + "
" + label(field, options[:label] || {}) + select(field, collection, options[:select] || {}) + -- libgit2 0.21.2