module OkComputer::LegacyRailsControllerSupport

Public Class Methods

included(base) click to toggle source
# File lib/ok_computer/legacy_rails_controller_support.rb, line 3
def self.included(base)
  # Support <callback>_action for Rails 3
  %w(before after around).each do |callback|
    unless base.respond_to?("#{callback}_action")
      base.singleton_class.send(:alias_method, "#{callback}_action", "#{callback}_filter")
    end
  end
end

Public Instance Methods

render(options = {}, &block) click to toggle source

Support ‘render plain’ for Rails 3

Calls superclass method
# File lib/ok_computer/legacy_rails_controller_support.rb, line 13
def render(options = {}, &block)
  options[:text] = options.delete(:plain) if options.include?(:plain)
  super
end