Hi all, i would like to add the .html extension by default to all my resources. What is the best way to do that? The reason for this is that i need to download the generated sites via wget and i need the .html extension for the downloaded files. Also it would be nice if the link_to would automatically generate the links with .html... Thanks, Gerold --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
how about a before/after_save callback? i guess that would work. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe i was a little too unspecific with my description. Let me try again: The website has multiple nested pages and i can address them with e.g. /pages/first /pages/first/subpage Now when i want to wget all of the pages the downloaded files are called first and subpage but i''d like them to be called first.html and subpage.html so i figured the easiest way to do that is to just add .html at the end of all pages by default. So when i add a resource to routes.rb like resources :pages i can call /pages/1 and i get the first page but again if i download it the file would be called 1 instead of 1.html... Also if i use link_to or url_for i get the links generated without the .html at the end... i tried resources :pages, :format => :html but i think the problem here is that html is the default mimetype and so it''s ignored. One sollution could be to set another mimetype as default so i would have to add the html format for every link i generate which would be ok for me... On Feb 24, 12:28 pm, MaD <mayer.domi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> how about a before/after_save callback? i guess that would work.--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
sounds a little bit silly, bit i just tried a route like map.connect '':controller/:action.html'' that is actually working for me http://localhost:3000/bla/index.html --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
i also figured that but i would really like to use resources... On Feb 24, 1:30 pm, MaD <mayer.domi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> sounds a little bit silly, bit i just tried a route like > map.connect '':controller/:action.html'' > that is actually working for me > http://localhost:3000/bla/index.html--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
> i would like to add the .html extension by default to all my > resources. What is the best way to do that? The reason for this is > that i need to download the generated sites via wget and i need > the .html extension for the downloaded files. Also it would be nice if > the link_to would automatically generate the links with .html...That''s a very bad idea. The better idea might be to add -E option to your wget call (and maybe -k too). Regards, Rimantas -- http://rimantas.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?hl=en -~----------~----~----~----~------~----~------~--~---
why is it a "very bad" idea? i don''t think that would be harmfull in any way. But if i can''t find an easy way to do it i will have to fix it with wget... On Feb 24, 1:48 pm, Rimantas Liubertas <riman...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > i would like to add the .html extension by default to all my > > resources. What is the best way to do that? The reason for this is > > that i need to download the generated sites via wget and i need > > the .html extension for the downloaded files. Also it would be nice if > > the link_to would automatically generate the links with .html... > > That''s a very bad idea. The better idea might be to add -E option to your > wget call (and maybe -k too). > > Regards, > Rimantas > --http://rimantas.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?hl=en -~----------~----~----~----~------~----~------~--~---
> why is it a "very bad" idea? i don''t think that would be harmfull in > any way. But if i can''t find an easy way to do it i will have to fix > it with wget...Well, sorry, but hacking application to get the result for the _external_ application (the same result you can get by adding two characters to the command line) does not sound like a good idea to me. There are other reasons why file extensions are bad on the web in general and in REST case in particular, but I won''t go into that now. Regards, Rimantas -- http://rimantas.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?hl=en -~----------~----~----~----~------~----~------~--~---