No commit activity in last 3 years
No release in over 3 years
Easy to set up translatable menus in Rails with ActiveAdmin, Devise, Globalize and a couple of friends, that does everything but the actual rendering.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Code Climate Test Coverage Build Status

TranslatableMenus

Install & setup

First bundle it like this in your Gemfile:

gem 'translatable_menus'

Then integrate it with ActiveAdmin through "/app/admin/translatable_menus.rb":

TranslatableMenus::ActiveAdminIntegrator.integrate!

Make a helper something like this in "/app/helpers/application_helper.rb":

module ApplicationHelper
  def top_menu_items
    topmenu_items = []

    if main_menu = TranslatableMenus::TranslatableMenu.find_by(identifier: "main")
      main_menu.menus.order(:sort_number).each do |menu_item|
        next unless should_show_menu?(menu_item)
        if menu_item.http_method == "get" || !menu_item.http_method.present?
          http_method = nil
        else
          http_method = menu_item.http_method
        end

        topmenu_items << link_to(menu_item.title, menu_item.url_to_use, method: http_method)
      end
    end

    return topmenu_items
  end
end

In your lauout you can iterate over the menu-items like this:

<% top_menu_items.each do |link| %>
  <span class="link"><%= link %></span>
<% end %>

License

This project rocks and uses MIT-LICENSE.