Doing my first Rails 2 project I''m utterly confused by Rails'' behavior concerning the use of html or xhtml in templates and the MIME types the final documents get send as. I have one controller that uses a layout. Within the layout tag helper methods return xhtml self-closing tag. But in the template for the individual actions html tags are used. The final document is transmitted as application/xml. Another controller — without a layout — transmits its actions as text/ html but uses xhtml tags. I have not tempered with any configs regarding this. I only experimented with the new template extensions, but found that using .xhtml.erb was not the way to toggle between the use of html or xhtml. Can anybody please shed some light on this, please? Thank you! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
sebastian wrote:> Doing my first Rails 2 project I''m utterly confused by Rails'' behavior > concerning the use of html or xhtml in templates and the MIME types > the final documents get send as. > I have one controller that uses a layout. Within the layout tag helper > methods return xhtml self-closing tag. But in the template for the > individual actions html tags are used. The final document is > transmitted as application/xml. > Another controller � without a layout � transmits its actions as text/ > html but uses xhtml tags. > I have not tempered with any configs regarding this. I only > experimented with the new template extensions, but found that > using .xhtml.erb was not the way to toggle between the use of html or > xhtml. > Can anybody please shed some light on this, please? > Thank you!Im not sure whats going on in your headers, but I am confused that you say you are getting mixed html and xhtml tags in your code. All the rails tag helpers should generate xhtml just fine. Other than that, rails won''t process your HTML at all. So if you insert unclosed single tags in your erb templates, thats exactly how they will be sent out. -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks for the reply, Alex You are, of course, right: the stray html tags where after all my own doing. And that one controller returned application/xml stemmed from the circumstance that in its layout I use a Builder template. Sometimes it''s just better to call it a day early and sleep it over — in this case at 4 pm. :) Cheers, Sebastian On May 13, 10:15 pm, Alex Wayne <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> sebastian wrote: > > Doing my first Rails 2 project I''m utterly confused by Rails'' behavior > > concerning the use of html or xhtml in templates and the MIME types > > the final documents get send as. > > I have one controller that uses a layout. Within the layout tag helper > > methods return xhtml self-closing tag. But in the template for the > > individual actions html tags are used. The final document is > > transmitted as application/xml. > > Another controller � without a layout � transmits its actions as text/ > > html but uses xhtml tags. > > I have not tempered with any configs regarding this. I only > > experimented with the new template extensions, but found that > > using .xhtml.erb was not the way to toggle between the use of html or > > xhtml. > > Can anybody please shed some light on this, please? > > Thank you! > > Im not sure whats going on in your headers, but I am confused that you > say you are getting mixed html and xhtml tags in your code. All the > rails tag helpers should generate xhtml just fine. Other than that, > rails won''t process your HTML at all. So if you insert unclosed single > tags in your erb templates, thats exactly how they will be sent out. > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---