This project is archived and is in readonly mode.
Erubis template parsing error on invalid match for variable name containing "do"
Reported by Mike | May 11th, 2010 @ 01:23 PM | in 3.0.2
Re: Rails 3.0.0.beta3
See add_expr_literal method in Template::Handlers::Erubis. The expression BLOCK_EXPR falsely matches "do" during template compilation for a variable named "todo."
To reproduce, generate a scaffold for an entity named "Todo." The default output for the "Show" link is malformed and generates a syntax error ("unexpected tIVAR, expecting keyword_do or '{' or '('").
BLOCK_EXPR probably just needs word boundaries or whitespace around the "do."
If necessary, this mailing list thread has additional info:
http://groups.google.com/group/rubyonrails-talk/browse_thread/threa...
Comments and changes to this ticket
-
Ryan Bigg May 13th, 2010 @ 11:45 PM
- Tag changed from 3.0.0.beta3, erubis to 3.0.0.beta3, bugmash, erubis
- State changed from new to incomplete
Please provide a failing test case and patch for this issue.
-
Jeff Kreeftmeijer May 15th, 2010 @ 11:37 PM
Verified on master. When I generate a scaffold called todo, start the server and go to /todos, it throws a SyntaxError:
compile error /Users/jeff/rails/tada/app/views/todos/index.html.erb:16: syntax error, unexpected tIVAR, expecting kDO or '{' or '(' ...to 'Show', todo @output_buffer.safe_concat('</td> ^
Here's the Framework Trace.
-
Simon Jefford May 16th, 2010 @ 01:31 AM
I've attached a patch
It doesn't have any tests at the moment - hoping to enlist some help on that front...
-
Santiago Pastorino May 16th, 2010 @ 06:33 AM
- Milestone cleared.
- Tag changed from 3.0.0.beta3, bugmash, erubis to 3.0.0.beta3, bugmash, bugmash-review, erubis, patch
- State changed from incomplete to open
- Assigned user set to José Valim
Well done Simon +1
-
Eric Hutzelman May 16th, 2010 @ 07:17 AM
+1 applies cleanly to master, tests pass. Scaffold generated Todo views no longer throw errors on 'show' links.
-
Repository May 16th, 2010 @ 02:16 PM
- State changed from open to resolved
(from [f58bdae1f716c71202546c5a40a951b5fc54a591]) Check blocks are not incorrectly detected when compiling erubis templates [#4575 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/f58bdae1f716c71202546c5a40a951... -
Rizwan Reza May 16th, 2010 @ 03:06 PM
- Tag changed from 3.0.0.beta3, bugmash, bugmash-review, erubis, patch to 3.0.0.beta3, bugmash, erubis, patch
-
Rizwan Reza May 16th, 2010 @ 04:49 PM
- Tag changed from 3.0.0.beta3, bugmash, erubis, patch to 3.0.0.beta3, bugmash-review, erubis, patch
- State changed from resolved to verified
-
Rizwan Reza May 16th, 2010 @ 04:51 PM
- State changed from verified to resolved
-
Rizwan Reza May 16th, 2010 @ 04:51 PM
- Tag changed from 3.0.0.beta3, bugmash-review, erubis, patch to 3.0.0.beta3, erubis, patch
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to High
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 4575 Erubis template parsing error on invalid match for variable name containing "do" (from [f58bdae1f716c71202546c5a40a951b5fc54a591]) Check b...