How can I manipulate RoR to produce an .xhtml file from the view template(s)? I see how I can use layouts and paritals to efficiently produce the content and tags that I need, but how can I get the actual file that''s produced to be named with the .xhtml suffix, (rather than *.htm, as it currently is)? [Note: I never thought the suffix was all that important, but evidenly Mozilla won''t behave in some cases unless the files is named with the xhtml suffix.] thanks, Alex -- Posted via http://www.ruby-forum.com/.
What?? Make sure your output validates and contains the correct doctype. I''ve never heard of such a thing. If this is true, I''d love to know more about it. On 7/14/06, Alex Auritt <alexauritt@yahoo.com> wrote:> > How can I manipulate RoR to produce an .xhtml file from the view > template(s)? I see how I can use layouts and paritals to efficiently > produce the content and tags that I need, but how can I get the actual > file that''s produced to be named with the .xhtml suffix, (rather than > *.htm, as it currently is)? [Note: I never thought the suffix was all > that important, but evidenly Mozilla won''t behave in some cases unless > the files is named with the xhtml suffix.] > > thanks, > Alex > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060714/2f8ebe43/attachment.html
Well, I made some changes, and now the output is validating when saved as an .xhtml file, and "tenatively validating" ("no character encoding found") when the identical file is saved as .html. Still, the .xhtml page renders perfectly in Mozilla, but the .html page does not. (I''m using MathML to display some equations, and these are the problems spots -- MathML only seems to work if the file has an .xhtml suffix.) Regardless, there must be some way to tailer RoR to a specific output file extension. No? Thanks so much. Brian Hogan wrote:> What?? > Make sure your output validates and contains the correct doctype. I''ve > never > heard of such a thing. If this is true, I''d love to know more about it.-- Posted via http://www.ruby-forum.com/.
On Fri, 14 Jul 2006, Alex Auritt wrote:> Still, the .xhtml page renders perfectly in Mozilla, but the .html page > does not. (I''m using MathML to display some equations, and these are > the problems spots -- MathML only seems to work if the file has an > .xhtml suffix.)My experience was that if the .html was served with the correct doctype as application/xhtml+xml that MathML worked, but this was some time ago. See: http://www.w3.org/TR/xhtml-media-types/ -- _Deirdre web / blog: http://deirdre.net/ "Memes are a hoax! Pass it on!"
Alex Auritt wrote:> Well, I made some changes, and now the output is validating when saved > as an .xhtml file, and "tenatively validating" ("no character encoding > found") when the identical file is saved as .html. >You set the encoding in the http headers, easy to do w/ a filter in the app controller. Here''s a ref: http://wiki.rubyonrails.com/rails/pages/HowtoSetDefaultEncoding> Still, the .xhtml page renders perfectly in Mozilla, but the .html page > does not. (I''m using MathML to display some equations, and these are > the problems spots -- MathML only seems to work if the file has an > .xhtml suffix.) > > Regardless, there must be some way to tailer RoR to a specific output > file extension. No? >Try URL rewriting in your webserver, or hacking around in routes.rb. But you really shouldn''t need to do this. Have you set the doctype correctly in your layout/views? There''s reference info on how to declare the processing instructions for docs with MathML, have you seen: http://www.w3.org/Math/XSL/ cheers, phil
To answer your question, you can set URL rewriting (including adding .xhtml to the end) using routes. http://manuals.rubyonrails.com/read/chapter/65 However, I agree with your other responders that you shouldn''t need to do this, and it''s better to keep the URLs clean and without extensions. http://www.w3.org/Provider/Style/URI - dan -- Dan Kohn <mailto:dan@dankohn.com> <http://www.dankohn.com/> <tel:+1-415-233-1000> On Jul 14, 2006, at 11:31 AM, Alex Auritt wrote:> How can I manipulate RoR to produce an .xhtml file from the view > template(s)? I see how I can use layouts and paritals to efficiently > produce the content and tags that I need, but how can I get the actual > file that''s produced to be named with the .xhtml suffix, (rather than > *.htm, as it currently is)? [Note: I never thought the suffix was all > that important, but evidenly Mozilla won''t behave in some cases unless > the files is named with the xhtml suffix.] > > thanks, > Alex > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Everyone, thanks so much. This has been invaluably helpful. Thanks so much for your patience and assistance. Dan Kohn wrote:> To answer your question, you can set URL rewriting (including > adding .xhtml to the end) using routes. > http://manuals.rubyonrails.com/read/chapter/65 > > However, I agree with your other responders that you shouldn''t need > to do this, and it''s better to keep the URLs clean and without > extensions. > http://www.w3.org/Provider/Style/URI > > - dan > -- > Dan Kohn <mailto:dan@dankohn.com> > <http://www.dankohn.com/> <tel:+1-415-233-1000>-- Posted via http://www.ruby-forum.com/.