infra updates
This commit is contained in:
@@ -1,21 +1,4 @@
|
||||
module ApplicationHelper
|
||||
def title(*args)
|
||||
res = content_tag :h1, class: 'page-title' do
|
||||
if args.first.is_a?(Symbol) && (args[1].respond_to?(:model_name) || args[1].class.respond_to?(:model_name))
|
||||
model = args[1].respond_to?(:model_name) ? args[1] : args[1].class
|
||||
if args.first == :index
|
||||
t('action.index.label', models: model.model_name.human_plural)
|
||||
else
|
||||
t("action.#{args.first}.label", model: model.model_name.human)
|
||||
end
|
||||
else
|
||||
args.first
|
||||
end
|
||||
end
|
||||
content_for :page_title, res
|
||||
res
|
||||
end
|
||||
|
||||
# overwrite i18n l, to handle nil values
|
||||
def l(*args)
|
||||
return '' unless args.first
|
||||
|
||||
Reference in New Issue
Block a user