Module: Slide::Down::Alerts::Rails::ViewHelpers

Defined in:
lib/slide-down-alerts-rails/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#slide_down_alertsObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/slide-down-alerts-rails/view_helpers.rb', line 7

def slide_down_alerts
  if flash[:notice] || flash[:alert] || flash[:error]
    if flash[:error]
      render :partial => "slide_down_alerts_rails/script_partial", :locals => { :method => "Error", :message => flash[:error] }
    elsif flash[:notice]
      render :partial => "slide_down_alerts_rails/script_partial", :locals => { :method => "Notification", :message => flash[:notice] }
    elsif flash[:alert]
      render :partial => "slide_down_alerts_rails/script_partial", :locals => { :method => "Warning", :message => flash[:alert] }
    end
  end
end