SpinaCMS / SpinaCMS.com

Public website
6 stars 1 forks source link

Syntax error in example code found in Navigations guide #22

Closed kfrz closed 1 year ago

kfrz commented 1 year ago

While reading this guide about navigations in SpinaCMS, I identified a syntax error. There is a missing %> in this block of code:

<!-- app/views/shared/_navigation.html.erb -->
<% navigation = Spina::Navigation.find_by(name: "main")
<% presenter = Spina::MenuPresenter.new(navigation) %>
<%= presenter.to_html %>

The right snippet is this:

<!-- app/views/shared/_navigation.html.erb -->
<% navigation = Spina::Navigation.find_by(name: "main") %>
<% presenter = Spina::MenuPresenter.new(navigation) %>
<%= presenter.to_html %>

This code snippet also fails with a NoMethodError when called by ruby/3.1.3/lib/ruby/gems/3.1.0/gems/activemodel-7.0.3.1/lib/active_model/attribute_methods.rb:458. I have filed a separate issue to the SpinaCMS repository. That issue can be found here.