Read more

Highlight current navigation item with Staticmatic

Thomas Eisenbarth
September 15, 2012Software engineer at makandra GmbH

StaticMatic Show archive.org snapshot is a nice tool to build simple static websites.
In case you want to have some nifty styles on the navigation item that is currently active, you can use this:

=link 'Aktuelles', :class => (current_page =~ /aktuelles/) ? 'current' : 'default'
Illustration online protection

Rails Long Term Support

Rails LTS provides security patches for old versions of Ruby on Rails (2.3, 3.2, 4.2 and 5.2)

  • Prevents you from data breaches and liability risks
  • Upgrade at your own pace
  • Works with modern Rubies
Read more Show archive.org snapshot

Keep in mind that current_page gives you the full relative path of your page. raise current_path in case you're not sure.

I know there is an navigation helper out there. I did not use it and also did not want to migrate.

Posted by Thomas Eisenbarth to makandra dev (2012-09-15 16:11)