Skip to content

Instantly share code, notes, and snippets.

@queso
Created July 29, 2009 18:49
Show Gist options
  • Save queso/158329 to your computer and use it in GitHub Desktop.
Save queso/158329 to your computer and use it in GitHub Desktop.
def method_missing(name, *args)
value = find_value(name)
value.empty? ? super(name, *args) : value
end
def find_value(name)
field_values.collect {|field_value| field_value.value.value if name.to_s == field_value.form_field.name.to_s.downcase}.flatten.compact.to_s
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment