-
Notifications
You must be signed in to change notification settings - Fork 136
Registering Renderers
Simon Courtois edited this page May 2, 2014
·
5 revisions
Here's one way of creating and registering your own renderer.
- Create a folder in app/navigation_renderers
- Create your renderer and put it in there (e.g. my_custom_renderer.rb)
- Add it to the load path in config/application.rb (Rails 3 and 4) or config/environment.rb (Rails 2)
- Tell simple-navigation about your renderer in an initializer file, like config/initializers/simple_navigation.rb:
SimpleNavigation.register_renderer my_renderer: MyCustomRendererThen you can use the renderer in the render_navigation call:
#navigation= render_navigation renderer: :my_rendererOr you can also use it without registering, just specify your class:
#navigation= render_navigation renderer: MyCustomRenderer