Sha256: 25abbf899757db39c9eb8e54c846c349a08d92039f6bab86a2343d20875a1052

Contents?: true

Size: 820 Bytes

Versions: 1

Compression:

Stored size: 820 Bytes

Contents

module DynamicMenu
  require 'engine' if defined?(Rails)
  
  module MenuItems
    def newmenuitem(name,link,method=:get,confirm="Are you sure?")
      if !defined?(@actionMenuItems)
        @actionMenuItems = Array.new
      end
      genlink = ""
      
      if method==:delete
        genlink += "<a href=\"#{link}\" data-confirm=\"#{confirm}\" data-method=\"delete\" rel=\"nofollow\">
         #{name}</a>".html_safe
      elsif link==:submit
        genlink += "<a href=\"#\" data-submit=\"true\">#{name}</a>".html_safe
       elsif link == :back
          genlink = "<a href=\"#\" data-back=\"true\">#{name}</a>".html_safe
       else
          genlink = "<a href=\"#{link}\">#{name}</a>".html_safe
      end      
      @actionMenuItems << genlink.html_safe
    end
    
    
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynamic_menu-2.0.2 lib/dynamic_menu.rb