Module: HandyControllerHelpers::FlashHelpers

Included in:
AllHelpers
Defined in:
lib/handy_controller_helpers/flash_helpers.rb

Instance Method Summary collapse

Instance Method Details

#flash_created?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/handy_controller_helpers/flash_helpers.rb', line 12

def flash_created?
  flash[:notice].should =~ /was successfully created/i
end

#flash_destroyed?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/handy_controller_helpers/flash_helpers.rb', line 16

def flash_destroyed?
  flash[:notice].should =~ /was successfully destroyed/i
end

#flash_recovered?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/handy_controller_helpers/flash_helpers.rb', line 20

def flash_recovered?
  flash[:notice].should =~ /was successfully recovered/i
end

#flash_unauthorized?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/handy_controller_helpers/flash_helpers.rb', line 4

def flash_unauthorized?
  flash[:alert].should =~ /You are not authorized to access this page/i
end

#flash_updated?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/handy_controller_helpers/flash_helpers.rb', line 8

def flash_updated?
  flash[:notice].should =~ /was successfully updated/i
end