I am currently developing an administrative suite using Ruby on Rails 3.2.
One of the tasks it needs to perform is the generation of contracts and invoices.
Because the application needs to accomodate multiple clients, I want each client to be able to upload some kind of template which dictates their personal style and layout. (i.e.: logo, company name, addr, etc).
I am thinking of letting clients create their own .docx contract templates using variables and placeholders which my application should replace whener a specific contract / invoice is generated. Note that the people creating the templates will not be tech savvy.
How should I be able to accomplish this? Note that there will placeholders which can be replaced directly as well as repeating elements which should be contained in tables. The number of these elements can vary from contract to contract.
After having considered many solutions, gems and examples available I am unable to find one which works for my situation. This is what I have tried so far:
I get the feeling I am missing something obvious. I cannot imagine that such a mundane task as document generation is so complicated when using Ruby on Rails.
After considering the alternatives I decided to go in a different route and I stumbled upon this: github.com/sandrods/odf-report
It is a ODF (open office) gem for Rails that lets you do the same thing as ruby-docx-templater, but it feels much more robust and doesn't break as easily as the docx variants...Even spellcheck can break up parts of a [First name] block and make it stop working