diff options
author | José Valim <jose.valim@gmail.com> | 2011-05-01 10:33:30 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-05-01 13:40:12 +0200 |
commit | d08f65118cc328de5493a68db33a155487f5fceb (patch) | |
tree | d46ea02ef1b754a81bcd8412a970b849aba45fcb /actionpack/lib/action_view/helpers/form_helper.rb | |
parent | e68b7a001de0959fcfb90b9d8c82b6b0bc1ccfb6 (diff) | |
download | rails-d08f65118cc328de5493a68db33a155487f5fceb.tar.gz rails-d08f65118cc328de5493a68db33a155487f5fceb.tar.bz2 rails-d08f65118cc328de5493a68db33a155487f5fceb.zip |
Start abstracting the renderer.
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_helper.rb')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index efe30441b1..68db17c254 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -102,6 +102,11 @@ module ActionView include FormTagHelper include UrlHelper + # Converts the given object to an ActiveModel compliant one. + def convert_to_model(object) + object.respond_to?(:to_model) ? object.to_model : object + end + # Creates a form and a scope around a specific model object that is used # as a base for questioning about values for the fields. # |