From cd305024f6aab45ea47efa5dfa6e13a150493524 Mon Sep 17 00:00:00 2001 From: Dan Croak Date: Mon, 13 Jul 2009 23:09:28 -0400 Subject: [PATCH] updated semi formal with working belongs_to field --- vendor/plugins/semi_formal/lib/semi_formal.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vendor/plugins/semi_formal/lib/semi_formal.rb b/vendor/plugins/semi_formal/lib/semi_formal.rb index 431b8af..cff3071 100644 --- a/vendor/plugins/semi_formal/lib/semi_formal.rb +++ b/vendor/plugins/semi_formal/lib/semi_formal.rb @@ -42,6 +42,11 @@ class SemiFormal < ActionView::Helpers::FormBuilder "
" end + # form.belongs_to :user + # + # returns a drop-down with value of User#id, text of User#to_s + # includes blank + # def belongs_to(field, *args) options = args.extract_options! @@ -53,7 +58,7 @@ class SemiFormal < ActionView::Helpers::FormBuilder "
" + label(field, options[:label] || {}) + - select(field, collection, options[:select] || {}) + select(field, collection, options[:select] || {}) + "
" end @@ -62,7 +67,6 @@ class SemiFormal < ActionView::Helpers::FormBuilder # html_options[:multiple] ||= true # html_options[:size] ||= 5 # end - end ActionView::Base.default_form_builder = SemiFormal -- libgit2 0.21.2