Sha256: 7e2bcbbac860fe3cb57f4bcdcd648f17bc722b6433c33b7a749b99382a47b54d

Contents?: true

Size: 554 Bytes

Versions: 9

Compression:

Stored size: 554 Bytes

Contents

require "baza_models"

module ::AwesomeTranslations::ApplicationHelper
  include BazaModels::Helpers::RansackerHelper
  include SimpleFormRansackHelper

  def flash_message_class(type)
    type = type.to_s
    type = "success" if type == "notice"
    type = "danger" if type == "alert"
    type = "danger" if type == "error"
    type
  end

  def path_without_root(path)
    path.gsub(/\A#{Regexp.escape(Rails.root.to_s)}(\/|)/, "")
  end

  def path_without_root_or_locales(path)
    path_without_root(path).gsub(/\Aconfig\/locales(\/|)/, "")
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
awesome_translations-0.0.58 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.57 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.56 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.55 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.54 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.53 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.52 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.51 app/helpers/awesome_translations/application_helper.rb
awesome_translations-0.0.50 app/helpers/awesome_translations/application_helper.rb