module Foundationize::ViewHelpers
Public Instance Methods
foundationize_flash()
click to toggle source
# File lib/foundationize/foundationize_viewhelpers.rb, line 5 def foundationize_flash flash_messages = [] flash.each do |type, message| next if message.blank? type = :alert if type == :error type = :success if type == :success type = :secondary if type == :notice Array(message).each do |msg| flash = raw("<div data-alert class=\"alert-box #{type}\">#{msg.html_safe}<a href=\"#\" class=\"close\">×</a></div>"); flash_messages << flash if msg end end flash_messages.join("\n").html_safe end
left_section(&block)
click to toggle source
# File lib/foundationize/foundationize_viewhelpers.rb, line 37 def left_section(&block) top_bar_section("left", &block) end
right_section(&block)
click to toggle source
# File lib/foundationize/foundationize_viewhelpers.rb, line 41 def right_section(&block) top_bar_section("right", &block) end
top_bar(options={}, &block)
click to toggle source
# File lib/foundationize/foundationize_viewhelpers.rb, line 23 def top_bar(options={}, &block) content_tag :nav, class: "top-bar" do content = "" content += content_tag :li, content_tag(:h1, link_to(options[:title],"#")), class: "name" content += content_tag :li, link_to(options[:text], "#"), class: options[:icon] ? "toggle-topbar menu-icon" : "toggle-topbar" html = content_tag :ul, raw(content), class: "title-area" content = capture(&block) html +=content_tag :section, content, class: "top-bar-section" raw html end end
top_bar_section(direction) { || ... }
click to toggle source
# File lib/foundationize/foundationize_viewhelpers.rb, line 45 def top_bar_section(direction, &block) content_tag :ul, class: direction do yield end end