Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 语法错误,意外=>,应为关键字\u end haml\u temp_Ruby On Rails - Fatal编程技术网

Ruby on rails 语法错误,意外=>,应为关键字\u end haml\u temp

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

我正在尝试将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 =>, 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的情况下盲目复制随机代码: