gluttonberg/lib/gluttonberg/helpers/admin.rb
def main_nav_entry(text, mod, url = nil, opts = {})
        if url
          li_opts = {:id => "#{mod}Nav"}
          if request.env["REQUEST_PATH"] && (request.env["REQUEST_PATH"].match(%r{/#{mod}}) || request.env["REQUEST_PATH"] == url)
            li_opts[:class] = "current"
          end
          tag("li", link_to(text, url, opts), li_opts)
        end
      end
# Takes text and url and checks to see if the path specified matches the 
# current url. This is so we can add a highlight.
Takes text and url and checks to see if the path specified matches the
current url. This is so we can add a highlight.
Takes text and url and checks to see if the path specified matches the current url . This is so we can add a highlight .
def main_nav_entry(text, mod, url = nil, opts = {})
        if url
          li_opts = {:id => "#{mod}Nav"}
          if request.env["REQUEST_PATH"] && (request.env["REQUEST_PATH"].match(%r{/#{mod}}) || request.env["REQUEST_PATH"] == url)
            li_opts[:class] = "current"
          end
          tag("li", link_to(text, url, opts), li_opts)
        end
      end
def main_nav_entry ( text , mod , url = nil , opts = { } ) if url li_opts = { :id => "#{mod}Nav" } if request . env [ "REQUEST_PATH" ] && ( request . env [ "REQUEST_PATH" ] . match ( %r{ / #{ mod } } ) || request . env [ "REQUEST_PATH" ] == url ) li_opts [ :class ] = "current" end tag ( "li" , link_to ( text , url , opts ) , li_opts ) end end
Takes text and url and checks to see if the path specified matches the
current url.
Takes text and url and checks to see if the path specified matches the current url .
text
mod
url
opts