Sha256: 846a7c9ce8cf89058057935953b0d32609ee67314f090859bd870652c433ed05

Contents?: true

Size: 460 Bytes

Versions: 3

Compression:

Stored size: 460 Bytes

Contents

module ApplicationHelper
  def flash_class(level)
    case level.to_sym
        when :notice then "alert alert-info"
        when :success then "alert alert-success"
        when :alert then "alert alert-warning"
        when :error then "alert alert-danger"
        else "alert-danger alert"
    end
  end

  def error_for( model_class, attribute, err_class )
    if model_class.errors[attribute].size > 0
      err_class
    else
      nil
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
happy_seed-0.0.3 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.2 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.1 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb