Permalink
Browse files

added active_link_to

  • Loading branch information...
1 parent fda19a9 commit 8e617a6a24fda56e4093c4d666f5cd982f53d624 @deanpcmad deanpcmad committed Mar 29, 2015
Showing with 15 additions and 9 deletions.
  1. +1 −0 Gemfile
  2. +3 −0 Gemfile.lock
  3. +11 −9 app/views/documentation/_nav.html.haml
View
@@ -9,6 +9,7 @@ gem 'haml'
gem 'nifty-utils'
gem 'redcarpet'
gem 'pygments.rb'
+gem "active_link_to"
group :development do
gem 'capistrano'
View
@@ -10,6 +10,8 @@ GEM
erubis (~> 2.7.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
+ active_link_to (1.0.2)
+ actionpack
activemodel (4.0.0)
activesupport (= 4.0.0)
builder (~> 3.1.0)
@@ -121,6 +123,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ active_link_to
capistrano
coffee-rails (~> 4.0.0)
haml
@@ -1,15 +1,17 @@
%nav
%ul
- %li= link_to "Welcome", docs_path, :class => action_name == 'index' && 'active'
+ %li= active_link_to "Welcome", docs_path, active: [["documentation"], ["index"]]
%h3 Getting Started Series
%ul
- %li= link_to "Setting up Shoppe", docs_page_path('tutorials/setting-up'), :class => action_name == 'page' && params[:path] == 'tutorials/setting-up' && 'active'
- %li= link_to "Displaying Products", docs_page_path('tutorials/products'), :class => action_name == 'page' && params[:path] == 'tutorials/products' && 'active'
- %li= link_to "Baskets", docs_page_path('tutorials/baskets'), :class => action_name == 'page' && params[:path] == 'tutorials/baskets' && 'active'
- %li= link_to "Checking out", docs_page_path('tutorials/checking-out'), :class => action_name == 'page' && params[:path] == 'tutorials/checking-out' && 'active'
+ %li= active_link_to "Setting up Shoppe", docs_page_path('tutorials/setting-up')
+ %li= active_link_to "Displaying Products", docs_page_path('tutorials/products')
+ %li= active_link_to "Baskets", docs_page_path('tutorials/baskets')
+ %li= active_link_to "Checking out", docs_page_path('tutorials/checking-out')
+ %h3 Payment Gateways
+ %ul
+ %li= active_link_to "Stripe", docs_page_path("payment-gateways/stripe")
+ %li= active_link_to "PayPal", docs_page_path("payment-gateways/paypal")
%h3 Further reading
%ul
- %li= link_to "Payment Gateways", docs_page_path('tutorials/payment-gateways'), :class => action_name == 'page' && params[:path] == 'tutorials/payment-gateways' && 'active'
- %li= link_to "Extending Shoppe", docs_page_path('extending'), :class => action_name == 'page' && params[:path] == 'extending' && 'active'
- %li= link_to "Tips & Tricks", docs_page_path('tips'), :class => action_name == 'page' && params[:path] == 'tips' && 'active'
- %li= link_to "API Documentation", "http://api.tryshoppe.com"
+ %li= active_link_to "Extending Shoppe", docs_page_path('extending')
+ %li= link_to "API Documentation", "http://api.tryshoppe.com"

0 comments on commit 8e617a6

Please sign in to comment.