Generating a form from a config file


I received a little help on #rubyonrails on freenode but am
still stuck. I am in a situation where I need to dynamically create a
from a config file. What I did was created a config/form.yml which
the following as an example:

field_name_here: &field_name_here
type: input_field
default: default_value_goes_here
label: some label would go here

I then have a helper method called get_dynamic_form. This method would
called from the view to load the config and generate a form. I have it
parsing the config, but i am unsure how to get it to send() the
methods to the view. Would I have to buffer the output and return it at
once, otherwise Obj.send() will send the data straight out, which will
work. I want to avoid generating html at all costs, as i want this to be
clean and consistent as possible.

If you have any recommendations, please let me know. Thanks :slight_smile: