Module: OkComputer::LegacyRailsControllerSupport
- Included in:
- OkComputerController
- Defined in:
- lib/ok_computer/legacy_rails_controller_support.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#render(options = {}, &block) ⇒ Object
Support ‘render plain’ for Rails 3.
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 10 |
# 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 |
Instance Method Details
#render(options = {}, &block) ⇒ Object
Support ‘render plain’ for Rails 3
13 14 15 16 |
# File 'lib/ok_computer/legacy_rails_controller_support.rb', line 13 def render( = {}, &block) [:text] = .delete(:plain) if .include?(:plain) super end |