ERB Error annotations question

View: New views
3 Messages — Rating Filter:   Alert me  

ERB Error annotations question

by Chris Kutler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I read somewhere in regards to error annotations in ERB files (I didn't make a note of the source when I added the statement to my notes)

"The IDE models what an ERB file will do in a Rails server and maps these errors back to the source."

Can anyone give me an example of this type of error that gets flagged in the source editor.

Or is this statement not true?

Chris

Re: ERB Error annotations question

by Tor Norbye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Aug 21, 2008, at 9:27 AM, Chris Kutler wrote:

I read somewhere in regards to error annotations in ERB files (I didn't make a note of the source when I added the statement to my notes)

"The IDE models what an ERB file will do in a Rails server and maps these errors back to the source."

Can anyone give me an example of this type of error that gets flagged in the source editor.

NetBeans simulates what the ERb tool will do in a Rails server; it will generate Ruby from it, then parse that Ruby, and any errors in that generated Ruby will then be shown - in the ERb file, at the ERb location corresponding to the place in the temporarily generated Ruby file where the parsing error occurred.

I think in 99% of cases (possibly 100% of cases), the errors will be a plain Ruby code error in your own scriptlet, e.g.

<div>
<% x = "unterminated string %>
</div>

-- Tor

Re: ERB Error annotations question

by Chris Kutler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is great. Thanks.

Tor Norbye wrote:
On Aug 21, 2008, at 9:27 AM, Chris Kutler wrote:

I read somewhere in regards to error annotations in ERB files (I didn't make a note of the source when I added the statement to my notes)

"The IDE models what an ERB file will do in a Rails server and maps these errors back to the source."

Can anyone give me an example of this type of error that gets flagged in the source editor.

NetBeans simulates what the ERb tool will do in a Rails server; it will generate Ruby from it, then parse that Ruby, and any errors in that generated Ruby will then be shown - in the ERb file, at the ERb location corresponding to the place in the temporarily generated Ruby file where the parsing error occurred.

I think in 99% of cases (possibly 100% of cases), the errors will be a plain Ruby code error in your own scriptlet, e.g.

<div>
<% x = "unterminated string %>
</div>

-- Tor
LightInTheBox - Buy quality products at wholesale price!