Sha256: c2ba04dc45157ae944c2d0ed4fde92ee8b246ae28fe3b0d3e2fe1020beda6322

Contents?: true

Size: 302 Bytes

Versions: 6

Compression:

Stored size: 302 Bytes

Contents

module MenuHelper
  def menu(name)
    menu = Menu.find_or_create_by(name: name)
    html = ''

    menu.links.each do |l|
      if l.new_tab?
        html << link_to(l.title, l.url, target: '_blank')

      else
        html << link_to(l.title, l.url)

      end
    end

    html.html_safe
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ants-0.3.14 app/helpers/menu_helper.rb
ants-0.3.13 app/helpers/menu_helper.rb
ants-0.3.12 app/helpers/menu_helper.rb
ants-0.3.11 app/helpers/menu_helper.rb
ants-0.3.10 app/helpers/menu_helper.rb
ants-0.3.9 app/helpers/menu_helper.rb