def obtain_menu(menu = nil,  sub = false, c = '')
			if menu.is_a? Integer
				data =
					if sub 
						MenuOption.where(:parent_id => MenuOption.find(menu).option_id)
					else 
						MenuOption.where(:menu_id => menu, :parent_id => nil)
					end
			else
				m = Menu.find_by_key(menu)
				data = 
					if m.blank? 
						[]
					elsif sub 
						MenuOption.where(:parent_id => MenuOption.find(m[:id]).option_id)
					else 
						MenuOption.where(:menu_id => m[:id], :parent_id => nil)
					end

			end


			html = "<ul class='menu_#{menu} #{c}'>"

			if !data.blank?
				
				data.each do |m|
					if m.parent_id != 0
						existingData = make_hash m.custom_data

						name = existingData['label']
						attributes = menu_routing(m)
						html += "<li class='menu_link_wrapper wrapper_#{existingData['class']}' ><a " + attributes + ">#{name}</a>"

						if descendants_count(m) > 0
							html += get_menu m.id, true

						end

						html += '</li>'

					end
				end
				
			end

			html +='</ul>'

			html.html_safe

		end
def obtain_menu(menu = nil,  sub = false, c = '')
			if menu.is_a? Integer
				data =
					if sub 
						MenuOption.where(:parent_id => MenuOption.find(menu).option_id)
					else 
						MenuOption.where(:menu_id => menu, :parent_id => nil)
					end
			else
				m = Menu.find_by_key(menu)
				data = 
					if m.blank? 
						[]
					elsif sub 
						MenuOption.where(:parent_id => MenuOption.find(m[:id]).option_id)
					else 
						MenuOption.where(:menu_id => m[:id], :parent_id => nil)
					end

			end


			html = "<ul class='menu_#{menu} #{c}'>"

			if !data.blank?
				
				data.each do |m|
					if m.parent_id != 0
						existingData = make_hash m.custom_data

						name = existingData['label']
						attributes = menu_routing(m)
						html += "<li class='menu_link_wrapper wrapper_#{existingData['class']}' ><a " + attributes + ">#{name}</a>"

						if descendants_count(m) > 0
							html += get_menu m.id, true

						end

						html += '</li>'

					end
				end
				
			end

			html +='</ul>'

			html.html_safe

		end
returns the menu in html format
 Params:
 +menu+:: the key of the menu that you want to return
 +sub+:: boolean as to wether the menu is a sub menu or not
 +c+:: class you want to give the UL