A very simple question that I canβt solve is how to add a new view to my commercial Ruby on Rails Spree application. I want to make a link to a link next to the main link in _main_nav_bar.html.erb, and when you click it, you will see a page about where the products are displayed. So:
home about cart
Click on the link:
home about cart
In the views / shared / _main_nav_bar.html.erb, the link I created (based on the home link) looks like this:
<li id="home-link" data-hook><%= link_to Spree.t(:home), spree.root_path %></li> <li id="about-link" data-hook><%= link_to Spree.t(:about), spree.about %></li>
The AboutController I created is as follows:
module Spree class AboutController < Spree::StoreController def index end end end
And finally, in config / routes.rb, I added the following code:
root :about => 'about#index'
When I try to start the server now, it just doesn't work anymore without causing an error message.
Can anyone help me with this issue? How to add a view and create a working link loaded in the main div?
EXTRA: routes.rb
MyStore::Application.routes.draw do mount Spree::Core::Engine, :at => '/' Spree::Core::Engine.routes.prepend do
source share