Skip to content
Browse files

Lookup field if only a name is given

  • Loading branch information...
1 parent 79e5244 commit 1a31bee0ce51971231e646af9a58b728255724f9 @jamesdabbs committed Mar 12, 2013
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/cave/form/builder.rb
View
2 lib/cave/form/builder.rb
@@ -2,6 +2,8 @@
class Cave::Form::Builder < ActionView::Helpers::FormBuilder
def bootstrap control_type, field
+ field = object.class.fields[field] if field.is_a?(Symbol)
+
error = object.errors[field.name]
value = object.lookup field.name

0 comments on commit 1a31bee

Please sign in to comment.
Something went wrong with that request. Please try again.