Forum: Ruby on Rails Error following the 15 minute blog with ROR Screen cast

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Tommo (Guest)
on 2009-04-28 01:53
(Received via mailing list)
Hello Everyone,

I was following this screen cast:
http://media.rubyonrails.org/video/rails_blog_2.mov

and when I got to the part about making a new file, creating a
template, and then rendering the partial, I received the following
error page:

SyntaxError in Posts#show

Showing app/views/posts/_post.html.erb where line #1 raised:

compile error
C:/Documents and Settings/Tomo/ror/blog/app/views/posts/_post.html.erb:
1: syntax error, unexpected kDO_BLOCK, expecting tCOLON2 or '[' or '.'
            old_output_buffer = output_buffer;post = local_assigns
[:post];object = local_assigns[:object];;@output_buffer = '';
__in_erb_template=true ;  div for @post do ; @output_buffer.concat
"\n"

^
C:/Documents and Settings/Tomo/ror/blog/app/views/posts/_post.html.erb:
6: syntax error, unexpected kENSURE, expecting $end
Extracted source (around line #1):

1: <% div for @post do %>
2:   <h2><%= link_to_unless_current h(post.title), post %></h2>
3:   <%= simple_format h(post.body) %>
4: <% end %>
Trace of template inclusion: app/views/posts/_post.html.erb, app/views/
posts/show.html.erb

RAILS_ROOT: C:/Documents and Settings/Tomo/ror/blog

Application Trace | Framework Trace | Full Trace
app/views/posts/_post.html.erb:6:in `compile!'
app/views/posts/show.html.erb:1
app/controllers/posts_controller.rb:18:in `show'
Request

Parameters:

{"id"=>"2"}
Show session dump

Response

Headers:

{"cookie"=>[],
 "Content-Type"=>"text/html",
 "Cache-Control"=>"no-cache"}


This question has been asked before but it does not seem like there
was an answer given.  Hopefully somebody will be able to help me out.
Thanks!

Tom
Frederick C. (Guest)
on 2009-04-28 01:55
(Received via mailing list)
On Apr 27, 9:33 pm, Tommo <removed_email_address@domain.invalid> wrote:
> 1: <% div for @post do %>

You've got a typo here -  it should be div_for

Fred
This topic is locked and can not be replied to.