Where to put to_xls and from_xls in a rails app
- by Joe Arasin
So I have a model that I need to be able to serialize to/read from an Excel(XLS) document. I am a bit of a loss as to where this code actually belongs. My initial thought is that the to_xls is a view, but after poking around and seeing things like (to|from)_xml and (to|from)_json in ActiveRecord, I was wondering if maybe this stuff belonged in the model. Alternatively, does it belong in just a whole separate container somewhere?
For what it's worth, users will be downloading models from the site, modifying them in excel, then posting them.