I'm trying to generate a form from a parsed json (in Hash form) with this helper
def hash_to_form(hash, fields, legend)
fields.fields_for do |b|
concat('<fieldset><legend>', legend, '</legend>')
hash.each do |key, attr|
if hash[key].is_a? Hash
hash_to_form(hash[key], b, key)
else
concat("<div class=\"field\">")
concat(b.label(key, key))
concat(b.text_field(key, :value => attr))
concat("</div>")
end
end
end
end
But it's giving me an wrong number of argument( 0 for 1) when i try to call the helper method. Which makes no sense since it takes 3 arguments?