Shouldn't rxml files be exempt from layout by default?

3 views
Skip to first unread message

Tim Lucas

unread,
Aug 29, 2006, 11:45:18 PM8/29/06
to rubyonra...@googlegroups.com
RJS templates are the only template type that are exempt from layout
by default.

Don't you think it makes sense to add rxml to the list of exempt
extensions? I'd assume most people would be surprised to see their
XML embedded in the middle of their (most probably) rhtml layout.

http://dev.rubyonrails.org/svn/rails/trunk/actionpack/lib/
action_controller/base.rb:

def template_exempt_from_layout?(template_name =
default_template_name)
template_name =~ /\.rjs$/ ||
(@template.pick_template_extension(template_name) == :rjs rescue false)
end

I've overrided it in my own application.rhtml as below but I'm
thinking that this should probably be the default behaviour.

def template_exempt_from_layout?(template_name =
default_template_name)
super || template_name =~ /\.rxml$/
end

-- tim lucas

DHH

unread,
Sep 1, 2006, 1:48:04 AM9/1/06
to Ruby on Rails: Core
> Don't you think it makes sense to add rxml to the list of exempt
> extensions? I'd assume most people would be surprised to see their
> XML embedded in the middle of their (most probably) rhtml layout.

rxml is used for more than just XML. It's also used by many for XHTML
where its perfectly reasonable to have and want a layout. rjs on the
other hand is decisively single-purpose, so there we can easily say
that a layout doesn't make sense.

Reply all
Reply to author
Forward
0 new messages