views:

22

answers:

1

I can figure out why this simple code would not compile. May be fresh eyes will see what I am missing.

<table>
<tr>
    <th></th>
    <th><%=h "Name <Email>" %></th>
    <th>Role</th>
</tr>
<% project.participations.each do |participation| %>
    <tr>
        <%= div_for(participation) do %>
        <td>some stuff</td>
        <td>more stuff</td>
        <% end %>
    </tr>
<% end %>
</table>

I am getting the error

compile error

/Users/leonid/Documents/rails_apps/appdepot/app/views/projects/_show_participants.html.erb:9: syntax error, unexpected ')' ...(( div_for(participation) do ).to_s); @output_buffer.concat ... ^ /Users/leonid/Documents/rails_apps/appdepot/app/views/projects/_show_participants.html.erb:14: syntax error, unexpected kEND, expecting ')' ; end ; @output_buffer.concat "\n\n" ^ /Users/leonid/Documents/rails_apps/appdepot/app/views/projects/_show_participants.html.erb:31: syntax error, unexpected kENSURE, expecting ')' /Users/leonid/Documents/rails_apps/appdepot/app/views/projects/_show_participants.html.erb:33: syntax error, unexpected kEND, expecting ')'

+3  A: 
<%= div_for(participation) do %>

should be

<% div_for(participation) do %>

without the equals sign in front

Sam
<%= div_for %> is valid syntax in Rails 3
zetetic
@zetetic: I don't think he's using Rails 3.
Ryan Bigg
Thank you. I am using Rails 2.3.8 but was looking at documentation for 3.)
LRaiz
yup, no problem :)
Sam