It sounds like you might want to implement an offline app instead. There is
browser support in most browsers for appcache to make all your assets
available offline, and there is the javascript call navigator.onLine that
will tell you if you are offline or not. You'll have to create and maintain
an appcache file. There is a gem that handles that, but I ended up just
creating an appcache controller and serving it myself.

This is quite a fundamental architecture change, though, so you might be
too far along in development to do it. You could create a small sample app
to prove the concept, then drag all your existing code into it.

See http://railscasts.com/episodes/247-offline-apps-part-1 for an
introduction.



On Mon, Jun 17, 2013 at 11:32 PM, Tamara Temple <tamouse.li...@gmail.com>wrote:

> Hernán Lucas P. <li...@ruby-forum.com> wrote:
> > I'm kinda newbie in RoR yet and I'm having a hard time trying to figure
> > out how should I implement this. I'm writing an application to store and
> > display information about insects and their distribution. Currently I
> > have almost all functionality implemented, except for a **very**
> > important one: The application must be capable of "crawling" itself and
> > generate a zip archive for download. Actually, crawling itself isn't
> > accurate enough, since the views must be sightly different (e.g. don't
> > provide functionality not available without Internet connection,
> > indicate in the title that the page is an offline copy, etc).
> >
> > The question is: Do you have any suggestions as to how I should
> > implement this?
>
> My suggestion is I hope simple. Use wget to crawl/mirror the site, using
> a query string parameter to indicate you want the "offline" views -- you
> still need to implement them if they are different enough -- by checking
> that the special parameter is set; you should be able to set it just
> once for the session, and have wget use cookies to maintain the session
> info.
>
> Another alternative instead of the query string parm could be using the
> user agent string wget sends, and always deliver the "offline" version
> to that UA string.
>
> The mirroring will pull all the urls that are included under the main
> one. If your assets are not under that main url, this won't work. You
> can tell wget to pull from elsewhere, but it can easily get out of
> hand.
>
> Hope this helps.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/51bfd4c9.a870320a.0dab.5746%40mx.google.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CABceSpAiw3sH7cdisBZdoy%3Dg5-_G1cOJbVE0u0P258W-bF3UGA%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to