Flowdock
method

add_flash_types

Importance_1
v6.0.0 - Show latest stable - 0 notes - Class: ClassMethods
add_flash_types(*types) public

Creates new flash types. You can pass as many types as you want to create flash types other than the default alert and notice in your controllers and views. For instance:

# in application_controller.rb
class ApplicationController < ActionController::Base
  add_flash_types :warning
end

# in your controller
redirect_to user_path(@user), warning: "Incomplete profile"

# in your view
<%= warning %>

This method will automatically define a new method for each of the given names, and it will be available in your views.

Show source
Register or log in to add new notes.