0

I am just wondering whether there is any work regarding the generation of static html files containing the output of the corresponding view of model objects.

Such an approach should also be able to regenerate outdated html files in case model object content changes.

I have done some research but couldn't find any appropriate solution...

1
  • page caching does it so you should dig this way Commented Jul 30, 2011 at 18:37

1 Answer 1

1

Your question is very hard to parse–some steps/examples of what you're trying to accomplish would help.

"output of the corresponding view of model objects"

Model/objects don't have corresponding views–actions (in controllers) do. I'll assume you're talking about basic CRUD/scaffolding views related to your models.

If that's the case, take a look at render_to_string. It's basically renders a view to a string instead of to the browser.

So, if you wanted some "automatic" generation of html files, you could have a special controller action that loaded some models, looped through them, rendered a view for each to a string, and then saved that string to an HTML file using the model's ID and a time stamp as the name.

If you wanted to get really automatic, you could then call the URL of your special controller action daily/weekly/monthly from a cron job using wget (with some authentication, natch).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.