Syntaxerror while starting server.

Hi there. I get an syntax error on this line (135) when i start my server. I have out-commented the line for now, but would really appreciate any help.

[code] error_messages = objects.map {|object| object.errors.full_messages.map {|msg|

Emil Kampp wrote:

error_messages = objects.map {|object| object.errors.full_messages.map {|msg|

Uh...

error_messages = objects.map{|object| object.errors.full_messages.map{|msg|

?

I think, if the posted code is _exactly_ what's in your file, that the Ruby parser cannot bond the second map to the second {. It compiles the equivalent of map;{ - which is a syntax error.

Phlip wrote:

I think, if the posted code is _exactly_ what's in your file, that the Ruby parser cannot bond the second map to the second {. It compiles the equivalent of map;{ - which is a syntax error.

--    Phlip    O'Reilly Media - Technology and Business Training

The code is _exactly_ the code in my file. It suddently began failing, for no apparent reason. I did not change this file, i changes something in the collection_select helper, then this error occured while i tried to create a new model from the terminal.

I have out-commented it, and now it compiles, but I guess the line _is_ important somewhere, so im reluctant to just keep it uncommented.

Can you post your line? So i can copy-paste yours? Perhaps mine have some strange encoded whitespace?

- Emil

Phlip wrote:

I think, if the posted code is _exactly_ what's in your file, that
the Ruby parser cannot bond the second map to the second {. It compiles the equivalent of map;{ - which is a syntax error.

--   Phlip   O'Reilly Media - Technology and Business Training

The code is _exactly_ the code in my file. It suddently began failing, for no apparent reason. I did not change this file, i changes
something in the collection_select helper, then this error occured while i tried to create a new model from the terminal.

That code just can't have ever worked. It looks like it's missing a
second line.

Fred

Frederick Cheung wrote:

That code just can't have ever worked. It looks like it's missing a second line.

Fred

Do you mind posting that line(s) from your file? So i can use those.

What file? I've been assuming this is something in your app.

Fred

Frederick Cheung wrote:

What file? I've been assuming this is something in your app.

Fred

No, it happens in the /usr/local/lib/ruby/gems/1.8/gems/actionpack1.13.5/lib/action_view/helpers/active_record_helper.rb:135

- Emil