Class: ActionController::Base
- Inherits:
-
Object
- Object
- ActionController::Base
- Defined in:
- lib/restfulx.rb
Overview
Override render to add support for render :fxml
Instance Method Summary collapse
- #old_render ⇒ Object
-
#render(options = nil, extra_options = {}, &block) ⇒ Object
so that we can have handling for :fxml option and write code like format.fxml { render :fxml => @projects }.
Instance Method Details
#old_render ⇒ Object
66 |
# File 'lib/restfulx.rb', line 66 alias_method :old_render, :render |
#render(options = nil, extra_options = {}, &block) ⇒ Object
so that we can have handling for :fxml option and write code like format.fxml { render :fxml => @projects }
70 71 72 73 74 75 76 77 78 |
# File 'lib/restfulx.rb', line 70 def render( = nil, = {}, &block) if .is_a?(Hash) && [:fxml] xml = [:fxml] response.content_type ||= Mime::XML render_for_text(xml.respond_to?(:to_fxml) ? xml.to_fxml : xml, [:status]) else old_render(, , &block) end end |