Title / Description
Code module ApplicationHelper def nav_links items = [] items << {:name =>'Home', :url => root_url} items << {:name =>'Login', :url => login_path} items << {:name =>'Register', :url => new_user_path} items.each do |item| current = (current_page? item[:url]) ? "current" : nil yield(current, link_to(item[:name], item[:url])) end end end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code