Hello Rails List! Thanks to those who commented on my prior thread about credit card handling; some smart, smart people on this list. Here''s another one for you: I have a client for whom I''m building a site. They insist on using their existing webhost, which runs PHP 4.3. OK, cool. Luckily, for now, the site is going to be largely static. I could use, say, Dreamweaver and build everything using Dreamweaver templates, but I would much rather hang the site off Rails for the following reasons: 1) Dreamweaver is US$400. Rails, SVN, and a text editor are free. 2) I''m likely to be more productive in Rails, since I haven''t touched Dreamweaver or its templating system for a few years. 3) Building it in Rails today offers a degree of futureproofing, for when the client calls me 6 months from now and says "we''d like to add a blog, a booking system, a forms repository, and oh... can we have the ability to edit everything over the web?" 4) OMGWTFBBQ. Rails is, like, my BFF xoxoxox <3 Then I got to thinking... I wonder if there''s a way to build a Rails site (which doesn''t use POST requests), and then dump the whole thing out – links, media, and all – to a set of static pages and files for launch on a plain webserver? I did a little searching on the web and on the Rails list; there were some folks a while back talking about using httrack, or wget to create a static mirror of a running Rails site. I gave it a shot with wget, and it showed some promise except for a few bugaboos: 1) "http://mydomain.com/controller/action" will get saved into a file named "action" in a "controller" directory. The lack of .htm extension on the file causes at least one webserver I tried this on to freak out and send the static file to the browser using a non-HTML content type. This, in turn, causes the HTML source to be displayed in the browser in plain text. 2) "http://mydomain.com/controller/action/" will fail (note the trailing slash) since no "action" directory exists. #1 and #2 could be solved if wget would simply save the output of "http:// mydomain.com/controller/action" to a file named "index.htm" in a "controller/action" directory. 3) wget will save image/css/js files along with Rails'' new timestamping/cachebusting tack-on, resulting in filenames such as "image.gif?44702193412". This will, of course, break the static site, since the webserver strips everything after the "?" when trying to access whatever file. So – what do you think? Comments? Suggestions? Links to prior art that I might have missed? Cheers, Steven Luscher (BDes Hons., Provisional RGD) { c = Steven Luscher Design; w = http://www.stevenluscherdesign.com/ } --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Steven Luscher wrote:> *Then I got to thinking... I wonder if there''s a way to build a Rails > site (which doesn''t use POST requests), and then dump the whole thing > out – links, media, and all – to a set of static pages and files for > launch on a plain webserver?* I did a little searching on the web and onCould you use page caching on all controllers/action. Visit all pages (perhaps programatically with a rake task) and then copy all the file in public/ up to the webserver (perhaps with a rake task or Capistrano setup). Eric --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 9/11/06, Steven Luscher <railslist-/zrraIZ5Wu9FX4DOhmH6ppOMunqAqVKM@public.gmane.org> wrote:> using httrack, or wget to > create a static mirror of a running Rails site. I gave it a shot with wget, > and it showed some promise except for a few bugaboos: > > 1) "http://mydomain.com/controller/action" will get saved > into a file named "action" in a "controller" directory. The lack of .htm > extension on the filewget --html-extension> causes at least one webserver I tried this on to freak > out and send the static file to the browser using a non-HTML content type. > This, in turn, causes the HTML source to be displayed in the browser in > plain text. > > 2) "http://mydomain.com/controller/action/" will fail (note > the trailing slash) since no "action" directory exists. #1 and #2 could be > solved if wget would simply save the output of > "http://mydomain.com/controller/action" to a file named > "index.htm" in a "controller/action" directory.wget --no-directories man wget -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
On 11-Sep-06, at 5:18 PM, Eric Anderson wrote:> Could you use page caching on all controllers/action.I was going to mention this, but thought I''d wait until someone brought it up. Could that actually work? On 11-Sep-06, at 5:32 PM, Greg Donald wrote:> wget --html-extension > wget --no-directoriesThanks for the notes Greg! "wget -k --html-extension --no- directories" solves a couple of problems, but creates another; if we''re going to start letting wget rename links and tack on .html extensions, then when we eventually do launch the site on Rails, any links made to the site from the outside will break (http:// mydomain.com/controller/action.html will become "http://mydomain.com/ controller/action" again). Steven Luscher (BDes Hons., Provisional RGD) { c = Steven Luscher Design; w = http://www.stevenluscherdesign.com/ } --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Steven Luscher wrote:> On 11-Sep-06, at 5:18 PM, Eric Anderson wrote: >> Could you use page caching on all controllers/action. > I was going to mention this, but thought I''d wait until someone > brought it up. Could that actually work?As long as you remember to run the app in production mode, it should. Then simply use wget to traverse the site, triggering all actions, and upload the cached files in public/ (ie not the wget files) to the host. -- Jakob Skjerning - http://mentalized.net --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Jeroen van Doorn
2006-Sep-12 13:11 UTC
Ticket #4795: ARs in the session have their associations persisted as well
Hi all, I have a question about the following ticket. The patch provided on this ticket fixes the problem (for me). Despite this fact, I don''t see this code in the trunk. Can someone tell me why this is? Another thing is that I tried to override this function in the lib directory, with the patch applied, but somehow, it still uses the old code. I wanted to fix my problem in a clean way by overriding the actioncontroller module. But I can''t get it working. And hacking a gem myself isn''t a long term solution. Thanks in advance, Jeroen van Doorn --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
i was going to post the same question after i completed my first rails app. it would be so nice to have a rake command that would do this and create a whole new directory with all the static content! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Steven Luscher wrote:> So ? what do you think? Comments? Suggestions? Links to prior art > that I might have missed?I have posted a similar question but got no replies... I am very interested though! I guess a good rake task can do the job... Bart --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---