Kieran P wrote:
> Hey,
>
> Yes, it should assume a file of the same type, and raise if there
> isn't.
>
> i.e.
>
> index.html.erb  renders  'example'  , should find example.html.erb or
> raise
>
> Same with xml:
>
> index.xml.erb  renders  'example' , should find example.xml.erb or
> raise
>
> But overwrites should be allowed:
>
> index.html.erb  renders  'example.xml.erb' , should work
>    
render "example.xml" would work just fine today on master, even with the 
change I'm proposing.

-- Yehuda
> Regards
> Kieran
>
>
>
> On Aug 9, 3:19 pm, Yehuda Katz<wyc...@gmail.com>  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.
>>
>> Is this behavior important? First of all, I'm not sure this is the right
>> behavior, since it's possible to be explicit about the format you wish
>> to use and rendering a template from a different MIME seems likely to be
>> a mistake. Second of all, it requires us to widen our search criteria
>> when looking for subsidiary templates (like partials), and prevents us
>> from efficiently caching the template for a given format (instead, we
>> need to cache the template for a given Array of formats, which is much
>> less efficient).
>>
>> I also think that restricting subsidiary templates would be consistent
>> with other (non-breaking) fixes we've done to ensure that layouts match
>> the MIME type of the template they are wrapping (which allowed us to
>> eliminate the exempt_from_layout hacks).
>>
>> Thanks for your attention,
>>
>> -- Yehuda
>>      
>
> >
>    

--~--~---------~--~----~------------~-------~--~----~
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