Ruby on rails 语法错误,意外=>,应为关键字\u end haml\u temp
我正在尝试将class属性应用于link_to block。在这一职位之后: 我写过:Ruby on rails 语法错误,意外=>,应为关键字\u end haml\u temp,ruby-on-rails,Ruby On Rails,我正在尝试将class属性应用于link_to block。在这一职位之后: 我写过: =link_to(who_we_are_path), :class => 'top-nav-anchor' do WHO WE ARE .glyphicon.glyphicon-plus 但是,我得到以下错误: al/app/views/shared/_top_nav.html.haml:110: syntax error, unexpected =>, exp
=link_to(who_we_are_path), :class => 'top-nav-anchor' do
WHO WE ARE
.glyphicon.glyphicon-plus
但是,我得到以下错误:
al/app/views/shared/_top_nav.html.haml:110: syntax error, unexpected =>, expecting keyword_end haml_temp = link_to(who_we_are_path), :class => 'top-nav-anchor' do
我使用新语法得到了相同的错误:
=link_to(who_we_are_path), class:'top-nav-anchor' do
WHO WE ARE
.glyphicon.glyphicon-plus
删除路径周围的括号
=link_to who_we_are_path, class:'top-nav-anchor' do
WHO WE ARE
.glyphicon.glyphicon-plus
您删除并。。。然后试着把它移到括号里:类的东西。不要在不了解stackoverflow的情况下盲目复制随机代码: