Class: Mack::Rendering::Action
- Defined in:
- lib/rendering/classes/action.rb
Overview
Used when someone calls render(:action => “index”)
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 21 22 |
# File 'lib/rendering/classes/action.rb', line 6 def render begin # Try to render the action: return render_file([:action], ) rescue Errno::ENOENT => e begin # If the action doesn't exist on disk, try to render it from the public directory: t = render_file([:action], {:dir => MACK_PUBLIC, :ext => ".#{params(:format)}", :layout => false}.merge()) # Because it's being served from public don't wrap a layout around it! # self.controller.instance_variable_get("@render_options").merge!({:layout => false}) return t rescue Errno::ENOENT => ex end # Raise the original exception because something bad has happened! raise e end end |