module RenderFlashNow::RenderFlash

Public Class Methods

included(base) click to toggle source
# File lib/render_flash_now/render_flash.rb, line 3
def self.included(base)
  base.class_eval do
    alias_method_chain :render, :flash
  end
end

Public Instance Methods

render_with_flash(*args) click to toggle source
# File lib/render_flash_now/render_flash.rb, line 9
def render_with_flash(*args)
  if options = args[1]
    self.class._flash_types.each do |flash_type|
      if type = options.delete(flash_type)
        flash.now[flash_type] = type
      end
    end
  end

  render_without_flash(*args)
end