each loop in a helper?

Try saving the output to a variable an returning it like this:
  def menu( menu )
    tag = ""
    menu.keys.each{|key|
      if !menu[key]['action'].nil? then
        tag += content_tag( :li, link_to( key, menu[key]['action'] ) )
      end
    }
    tag
  end

Andy Watts wrote: