On Aug 9, 2009, at 1:46 AM, Michael Koziarski wrote:

>
>> In Rails 2.x, if you have an XML template, and try to render a  
>> template
>> that does not have an XML version, but does have an HTML version, it
>> will be rendered. XML and HTML are just examples; this is true for  
>> any
>> two mime types.
>
> I'm guessing that the historical basis for this behaviour is:
>
> xml.content render :partial=>"post", :object=>post
>
> So long as we support :format=>:html in that call, I think the change
> is worth making in 3.0. I'd also suggest that the exception gave a
> useful message like:
>
> Template not found: post.xml, found post.html.  If that's what you
> wanted use render ... :format=>:html

I'd also assume the behavior might be left over from the early days of  
bare .erb templates - there are still a few of those in the test  
suite, and I remember it was a headache when sorting out the 'JS  
responses get wrapped in HTML layouts' mess.

--Matt Jones

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to