Error following the 15 minute blog with ROR Screen cast

Hello Everyone,

I was following this screen cast:

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

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 %>

<%= link_to_unless_current h(post.title), post %>

3: <%= simple_format h(post.body) %>
4: <% end %>
Trace of template inclusion: app/views/posts/_post.html.erb, app/views/

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:inshow’


Show session dump




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.


On Apr 27, 9:33 pm, Tommo [email protected] wrote:

1: <% div for @post do %>

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


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs