Module: EaselHelpers::Helpers::RjsHelper

Included in:
EaselHelpers::Helpers
Defined in:
lib/easel_helpers/helpers/rjs_helper.rb

Instance Method Summary collapse

Instance Method Details

#inline_flash(page, flash, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/easel_helpers/helpers/rjs_helper.rb', line 5

def inline_flash(page, flash, options = {})
  container_id = options[:container] || "flash-container"
  current_flash = flash

  flash.discard unless options[:keep_flash]

  if options[:replace]
    page.replace_html container_id, messages(current_flash)
  else
    page.insert_html :top, container_id, messages(current_flash)
  end
end