简体   繁体   中英

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). I am using 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 ("right_arrow.png", :size => '20x20')

It should be

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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