Skip to content

Instantly share code, notes, and snippets.

@davidlesches davidlesches/form.rb Secret
Last active Jan 1, 2016

Embed
What would you like to do?
Yodlee and Rails Implementation, Part 3: Forms - app/models/yodlee/form.rb
module Yodlee
class Form
attr_reader :fields, :wrapper
def initialize opts
@fields = opts[:fields]
@wrapper = opts[:wrapper]
end
def render
fields.componentList.map do |element|
type = element.fieldType.typeName.downcase.classify
Yodlee::Fields.const_get(type).new(field: element, wrapper: wrapper).render
end.join('').squish
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.