Class: Mack::Rendering::Xml
Overview
Used when someone calls render(:xml => “rss_feed”)
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mack::Rendering::Base
Instance Method Details
#render ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rendering/classes/xml.rb', line 6 def render begin # Try to render the action: return render_file([:xml], .merge(:format => :xml, :ext => ".xml.erb")) rescue Errno::ENOENT => e begin # If the action doesn't exist on disk, try to render it from the public directory: t = render_file([:xml], {:dir => MACK_PUBLIC, :ext => ".xml.erb", :layout => false}.merge(.merge(:format => :xml))) return t rescue Errno::ENOENT => ex end # Raise the original exception because something bad has happened! raise e end end |