Module: AwesomeTranslations::ApplicationHelper

Includes:
BazaModels::Helpers::RansackerHelper
Defined in:
app/helpers/awesome_translations/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#flash_message_class(type) ⇒ Object



6
7
8
9
10
11
12
# File 'app/helpers/awesome_translations/application_helper.rb', line 6

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

#path_without_root(path) ⇒ Object



14
15
16
# File 'app/helpers/awesome_translations/application_helper.rb', line 14

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

#path_without_root_or_locales(path) ⇒ Object



18
19
20
# File 'app/helpers/awesome_translations/application_helper.rb', line 18

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