I'm trying to add a navigation link from a plugin that I made without altering the main app files. For example, say that I have this:
app/views/shared/_navigation.html.erb
<ul id="navigation">
<li><a href="#">Nav link A</a></li>
<li><a href="#">Nav link B</a></li>
<li><a href="#">Nav link C</a></li>
</ul>
If I have a custom plugin called "recipes" in my vendor/plugins file and I wanted to add this:
<li><a href="link_to_recipes">Recipes</a></li>
to the _navigation.html.erb file mentioned above (after the "Nav link C" link), what would I have to do?
I believe that you can provide hooks in the plugin's init.rb file, and you can also install or register new items in the install.rb file, but I can't seem to find the info on how to have a plugin add a link to an existing _navigation.html.erb file.
I am thinking I have to alter the navigation file to something like this:
<ul id="navigation">
<li><a href="#">Nav link A</a></li>
<li><a href="#">Nav link B</a></li>
<li><a href="#">Nav link C</a></li>
<div id="links_from_plugins">
<!-- links from plugins will go here -->
</div>
</ul>
..and then add links from the plugin's init.rb to the #links_from_plugins id somehow.
Any ideas?