views:

10

answers:

1

I am trying to take an html file created by MSWord (don't ask) clean it up and create a form out of it on the fly. I am doing this work in the model (clean it up, create the form, stuff it in a DB). I would like to use the form_tag helpers, but can't quite get the hang of including them for use in the model. When I do an "include ActionView::Helpers::FormTagHelper" the helpers aren't available.

So, I figure either

  • I should be doing the clean up & create in a helper
  • I fundamentally don't grasp including in a model
  • All of the above.

Suggestions?

A: 

Form tags should not be included in the model. They are for views only.

I've got to ask. Why? It sounds like you're in for a wold of hurt.

Anna
Groan. I have MSWord templates coming from multiple sources and the datafields need to be mapped into a DB. Of course, multiple sources don't define their template fields the same way, so I have to create an online "form" to help the users map their datafields to the DB. BTW: wide open to alternative suggestions here - my head hurts.
Paul