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.2.2 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.1 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.2.0 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.22 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.21 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.20 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.19 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.18 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.17 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.16 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.15 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.14 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.13 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.12 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.11 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.10 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.9 app/helpers/thecore_helper.rb
thecore_ui_rails_admin-2.1.8 app/helpers/thecore_helper.rb
thecore_ui_layout_taris_website-1.2.1 app/helpers/thecore_helper.rb
thecore_ui_layout_taris_website-1.2.0 app/helpers/thecore_helper.rb