Module: AdminHelper
- Defined in:
- lib/generators/admin_interface/templates/helpers/admin_helper.rb
Instance Method Summary collapse
-
#content_for(name, content = nil, &block) ⇒ Object
Following methods are ripped from RedMine but very nice!.
- #has_content?(name) ⇒ Boolean
-
#render_flash_messages ⇒ Object
Renders flash messages.
Instance Method Details
#content_for(name, content = nil, &block) ⇒ Object
Following methods are ripped from RedMine but very nice!
5 6 7 8 9 |
# File 'lib/generators/admin_interface/templates/helpers/admin_helper.rb', line 5 def content_for(name, content = nil, &block) @has_content ||= {} @has_content[name] = true super(name, content, &block) end |
#has_content?(name) ⇒ Boolean
11 12 13 |
# File 'lib/generators/admin_interface/templates/helpers/admin_helper.rb', line 11 def has_content?(name) (@has_content && @has_content[name]) || false end |
#render_flash_messages ⇒ Object
Renders flash messages
16 17 18 19 20 21 22 |
# File 'lib/generators/admin_interface/templates/helpers/admin_helper.rb', line 16 def flash_string = '' flash.each do |k,v| flash_string << content_tag('div', v, :class => "flash #{k}") end flash_string.html_safe end |