Module: Admin::ApplicationHelper
- Defined in:
- lib/generators/overlook/install/templates/helpers/admin/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#flash_messages ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/generators/overlook/install/templates/helpers/admin/application_helper.rb', line 2 def classes = { notice: 'success', warning: 'warning', error: 'error' } output = flash.map do |name, | if .present? class_name = ['alert', "alert-#{classes[name]}"].join(' ') << '<a class="close" data-dismiss="alert">×</a>' content_tag(:div, class: 'span12') do content_tag(:div, raw(), class: class_name) end end end raw(output.join) end |
#nav(name) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/generators/overlook/install/templates/helpers/admin/application_helper.rb', line 19 def nav(name) class_name = params[:controller].eql?("admin/#{name}") ? 'active' : nil content_tag(:li, class: class_name) do link_to(name.to_s.titleize, "/admin/#{name}") end end |