17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/e9_rails/helpers/title.rb', line 17
def title(*args)
options = args.
if !args.empty?
@_title = args.dup
base_title = sanitize(args.shift)
options[:class] = [options[:class], 'title'].compact.join(' ')
options[:class].concat(' error') if options[:error]
unless options[:hide_title]
content = base_title
content = content_tag(options[:inner_tag], content) if options[:inner_tag]
content_tag(:h1, options.slice(:id, :class)) do
''.tap do |html|
html.concat options[:prepend] if options[:prepend]
html.concat content
html.concat options[:append] if options[:append]
end
end
end
end
end
|