That would work. You may want to consider if it is just HTML text, or if the
reports reference any images, video, additional files..., and whether you
want to keep them too.

If you have a complex HTML page, and you want to use the DB approach
(instead of just saving the file directly in disk and keeping the path in
the DB), you may want to take a look to MHTML, parse the HTML and encode all
the page elements using that format.

C

On Wed, May 25, 2011 at 8:15 AM, Sebastian
<[email protected]>wrote:

> Hi,
>
> I want to create some reports on my app that are stored. So it is not
> a big deal to create a view where my report is shown out of some
> existing activerecords.
>
> But how can I save what I see? Meaning save the whole page as report
> in the database. I thought the easiest way is to store the whole page
> in a long string with html markup. So I can easily render that value
> later with 'raw' method.
>
> An example:
>
> store this as activerecord:
> <p>This is some text</p>
>
> call that in a later view for showing the report:
> <%= raw Report.find(12).text %>
>
> Is that the best approach or is there another one? If it is the best
> approach, is there a way to get the html code of the recent page to
> store that in an activerecord.
>
> Sebastian
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to