Sha256: 888a3b3e8c8a68683ef1f062e5c8e76080c5b3f5b0bf9c1621f0df6e64b6a6a3

Contents?: true

Size: 307 Bytes

Versions: 10

Compression:

Stored size: 307 Bytes

Contents

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

    menu.links.each do |l|
      if l.target_blank
        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

10 entries across 10 versions & 1 rubygems

Version Path
ants-0.3.5 app/helpers/menu_helper.rb
ants-0.3.4 app/helpers/menu_helper.rb
ants-0.3.3 app/helpers/menu_helper.rb
ants-0.3.2 app/helpers/menu_helper.rb
ants-0.3.1 app/helpers/menu_helper.rb
ants-0.3.0 app/helpers/menu_helper.rb
ants-0.2.8 app/helpers/menu_helper.rb
ants-0.2.7 app/helpers/menu_helper.rb
ants-0.2.6 app/helpers/menu_helper.rb
ants-0.2.5 app/helpers/menu_helper.rb