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-3.0.11 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.10 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.9 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.8 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.7 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.6 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.5 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.4 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.3 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-3.0.0 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.7 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.5 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.4 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.3 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.2.pre.test app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.1 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.7.0 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.6.3 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.6.2 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.6.1 app/helpers/thecore_helper.rb