Sha256: 6d87680ee652a25d097a40f15ca6360d9203ebc8561477a3dc1d62dc044d2568

Contents?: true

Size: 1.14 KB

Versions: 87

Compression:

Stored size: 1.14 KB

Contents

module ThecoreHelper
  def bootstrap_class_for(flash_type)
    {
        success: "alert-success",
        error: "alert-error",
        alert: "alert-danger",
        notice: "alert-info"
    }[flash_type.to_sym] || flash_type.to_s
  end

  def bootstrap_glyphs_icon(flash_type)
    {
        success: "glyphicon-ok",
        error: "glyphicon-exclamation-sign",
        alert: "glyphicon-warning-sign",
        notice: "glyphicon-info-sign"
    }[flash_type.to_sym] || 'glyphicon-screenshot'
  end

  def title(title)
    content_for(:title) { title }
  end

  def meta_description(meta_description)
    content_for(:meta_description) { meta_description }
  end

  def og_title(og_title)
    content_for(:og_title) { og_title }
  end

  def og_description(og_description)
    content_for(:og_description) { og_description }
  end

  def og_image(og_image)
    content_for(:og_image) { og_image }
  end

  def bootstrap_class_for(flash_type)
    case flash_type
    when 'success'
      'alert-success'
    when 'error'
      'alert-danger'
    when 'alert'
      'alert-warning'
    when 'notice'
      'alert-info'
    else
      flash_type.to_s
    end
  end
end

Version data entries

87 entries across 87 versions & 2 rubygems

Version Path
thecore_ui_rails_admin-2.4.1 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.4.0 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.7 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.6 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.5 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.4 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.3 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.2 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.1 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.3.0 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.12 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.11 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.10 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.9 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.8 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.7 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.6 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.5 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.4 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.3 app/helpers/thecore_helper.rb