开发者

Rails3 ERB syntax requires a commented-out ERB block

开发者 https://www.devze.com 2023-03-04 12:45 出处:网络
Going from Rails 2.3.x to Rails 3.0.7 requires a change in ERB syntax that I just don\'t get. I am getting a SyntaxError ( une开发者_运维技巧xpected kEND ) and I can make the error go away if I add t

Going from Rails 2.3.x to Rails 3.0.7 requires a change in ERB syntax that I just don't get.

I am getting a SyntaxError ( une开发者_运维技巧xpected kEND ) and I can make the error go away if I add the following commented-out line before the 'unexpected' kEND:

# %><%

This doesn't make sense to me and the fix is ugly. What am I doing wrong?

Here is the complete partial template code, and the error can be toggled by removing line # 19: http://pastie.org/1881607


UPDATE: I changed from ERB to HAML syntax to avoid this completely and have more readable code.

However, I believe the cause was ERB deprecation warnings in other template files included in application layout. Fixing the ERB deprecation warnings, I believe, would have fixed this problem.


[ a duplicate of my update to the actual question above ]

I believe the cause was ERB deprecation warnings in other template files included in application layout. Fixing the ERB deprecation warnings, I believe, would have fixed this problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消