All threads / Archive old pages to a static page

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

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 :)

Join the discussion

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

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

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

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.