简体   繁体   English

Rails link_to语法错误:意外的',',预期为')'

[英]Rails link_to syntax error: unexpected ',', expecting ')'

I recently attempted to add bootstrap-sass to my rails app, and it seemed to have broken all my links (the links were fully functional before installing the bootstrap-sass gem). 我最近尝试将bootstrap-sass添加到我的rails应用程序中,它似乎断开了我的所有链接(在安装bootstrap-sass gem之前,这些链接是完全可用的)。 I am using ruby 1.8.7. 我正在使用ruby 1.8.7。

A sample link I have is: 我有一个示例链接:

<%=link_to image_tag ("right_arrow.png", :size => '20x20'), project_step_path(@project, @step.number+1) %>

The error I am getting is: 我得到的错误是:

syntax error, unexpected ',', expecting ')' ...o(image_tag ("right_arrow.png", :size => '20x20'), project_s...

Anyone know how to fix this? 有人知道怎么修这个东西吗?

There is an extra-space after image_tag. image_tag之后有一个多余的空格。

image_tag ("right_arrow.png", :size => '20x20')

It should be 它应该是

image_tag("right_arrow.png", :size => '20x20')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM