I'm new to Spree and can't seem to wrap my head around the "erb[loud]" way of replacing dynamic rails content...
I am simply trying to replace the 'Home' link on the navigation bar with different text like "Newest Products". The text will redirect the user to the exact same index page...I just want to replace the link w/ some different text. The partial in spree core is:
spree / frontend / app / views / spree / shared / _main_nav_bar.html.erb...
<nav class="columns sixteen">
<ul id="main-nav-bar" class="inline" data-hook>
<li id="home-link" data-hook><%= link_to Spree.t(:home), spree.root_path %></li>
<li id="link-to-cart" data-hook>
<noscript>
<%= link_to Spree.t(:cart), '/cart' %>
</noscript>
</li>
<script>Spree.fetch_cart()</script>
</ul>
</nav>
So far I've created an override file to use deface in my app at:
store / app / overrides / change_home_text.rb
Deface::Override.new(:virtual_path => 'spree/shared/_main_nav_bar',
:name => 'change_home_text',
:replace => "erb[loud]:contains('<li id="home-link" data-hook><%= link_to Spree.t(:home), spree.root_path %></li>')",
:text => "<li id="home-link" data-hook><%= link_to, 'Newest Products', Spree.t(:home), spree.root_path %></li>")
How should the :replace and :text lines be setup to correctly replace the link w/ the new text?
much appreciated,