eznav - D4uS1/ez-on-rails GitHub Wiki

eznav - generator

This generator creates the navigation menu of the administration backend depending on the existing routes.

rails generate ez_on_rails:eznav

Have a look to the (Navigation Concept Page)[https://github.com/D4uS1/ez-on-rails/wiki/Navigation] to understand how the routes are identified. You have to think about your scaffolds namespace locations if you want to make use of this generator.

Basically, in short, every scaffold or action that is found is reasonable placed in the main menu or one of its submenu. If your actions or scaffolds are located in an namespaces, a main menu entry of the namespace will be created containing submenus of your actions and scaffolds belonging to this namespace. If a scaffold is identified, its menu entry only targets the index action.

The following steps are executed by the generator

1. Create the navigation

  • Existing menu entries are not affected
  • The resulting menu structure is saved to the app/helpers/ez_on_rails/menu_structure_helper.rb file