Sha256: 0a68c01af42e0f41edaf80eaf96264480691c8440773e5faa8b03f5b5f0aed46

Contents?: true

Size: 548 Bytes

Versions: 8

Compression:

Stored size: 548 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

  def page_title
    @title || controller_name.gsub( /Controller/, "" ).humanize
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
happy_seed-0.0.11 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.10 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.9 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.8 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.7 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.6 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.5 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb
happy_seed-0.0.4 lib/generators/happy_seed/bootstrap/templates/app/helpers/application_helper.rb