M
M
Mikhail Beloshitsky2016-03-29 09:14:04
Ruby on Rails
Mikhail Beloshitsky, 2016-03-29 09:14:04

How to render a complex report?

Hello toaster, there is one report.
The report is complex, it makes selections from many models, then groups the data, etc. The question is, how will it be most convenient to transfer such data to the view? Put in rubihash or write a class? Do rails offer any standard solutions for such purposes?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2016-04-07
@mbeloshitsky

I usually store all the data in the rubyhash in the controller / model, and then display it in the view.
Using a class might be overkill. Rails is not required to provide solutions for every occasion. That's what gems are for.
For complex reports, you can use helpers to automate building blocks.
Moreover, the final report can be presented in the end as pure data in XML (as a serialized rubihash), and then transformed into the desired representation using XSLT:
Creating Word reports with XSL transformations

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question