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" + "