Class: ActionController::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboss_on_ruby.rb

Instance Method Summary collapse

Instance Method Details

#old_renderObject



27
# File 'lib/ruboss_on_ruby.rb', line 27

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 }



31
32
33
34
35
36
37
38
39
# File 'lib/ruboss_on_ruby.rb', line 31

def render(options = nil, extra_options = {}, &block)
  if options and options[:fxml]
    xml = options[:fxml]
    response.content_type ||= Mime::XML
    render_for_text(xml.respond_to?(:to_fxml) ? xml.to_fxml : xml, options[:status])
  else
    old_render(options, extra_options, &block)
  end
end