Skip to content

Instantly share code, notes, and snippets.

@dmix
Created September 2, 2009 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmix/179913 to your computer and use it in GitHub Desktop.
Save dmix/179913 to your computer and use it in GitHub Desktop.
def init_nav
# form: { :section => [ [ :pageA, :pageB ], :option1, :option2 ] }
@nav = [
{ :company => [ [ :who_we_are, :clients, :careers ] ] },
{ :approach => [ [ :methodology, :technologies ], :testimonials ] },
{ :solutions => [ [ :business_solutions, :product_development, :managed_hosting ], :testimonials ] },
{ :labs => [ [ :projects, :open_source ] ] },
{ :contact => [ [ :contact_us ] ] }
]
@site_page = action_name.to_sym
@nav.each do |category|
if (category.values.first.first.include?(@site_page) || category.keys.first == @site_page)
@nav_category = category
@nav_site_pages = @nav_category.values.first.first
@nav_options = @nav_category.values.first[1..-1]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment