Module: Admin::ApplicationHelper
Instance Method Summary
collapse
#alert_class_for, #author, #summary
Instance Method Details
14
15
16
17
|
# File 'app/helpers/bigmouth/admin/application_helper.rb', line 14
def ()
current_url = request.["SCRIPT_NAME"] + request.["PATH_INFO"]
current_url.match() ? ' class="active"' : ""
end
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'app/helpers/bigmouth/admin/application_helper.rb', line 19
def
items = [
{ text: "Articles", path: admin_articles_path },
{ text: "Images", path: admin_images_path }
]
html = ""
items.each do |item|
text = item[:text]
path = item[:path]
html += %(<li#{(path)}><a href="#{path}">#{text}</a></li>)
end
html.html_safe
end
|
#uploaded_by(image) ⇒ Object
6
7
8
9
10
11
12
|
# File 'app/helpers/bigmouth/admin/application_helper.rb', line 6
def uploaded_by(image)
if image.user.present?
image.user[Bigmouth.config.username_key.to_sym] || "Guest"
else
"Guest"
end
end
|