Ask A Question

Notifications

You’re not receiving notifications from this thread.

Archive old pages to a static page

John van Arkelen asked in Rails

Maybe a weird question, but I have a report dashboard application, where a specific report contains a lot of records in the database. In general users only check the last 3 reports frequently, so I was wondering if there is an option to convert older reports to a static web page. This way these old reports can be served as static web pages and I don't need to store all those records in the database anymore. Any suggestions how to do this are welcome!

Regards,
John

Reply

You could try using render_to_string & save the rendered view in your database, then when you need to show this report you can render :html that.

Just an idea, not tested :)

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 74,071+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2023 GoRails, LLC. All rights reserved.