I am a Rails newbie but have programmed other languages/frameworks
There's a trivial syntax error I can't for the life of me figure out.
I am following the well-known Ruby On InstantRails tutorial from here:
I am overriding the default 'edit' method on the recipe controller. I
get the error in the edit.rhtml while creating the drop down for
The relevant snippet is produced below:
<select id="cboCategory" name="recipe[category_id]">
<%= @categories.each do |category| %>
<option value="category.id" <%= 'selected' if
@recipe.category_id == category.id %> >
<%= category.name %>
<% end %>
I don't see anything wrong with that. However, I get an error as
./script/../config/../app/views/recipe/edit.rhtml:37: syntax error,
_erbout.concat "\t\t\t\t\t\t"; _erbout.concat(( @categories.each do |
category> ).to_s); _erbout.concat "\n"
./script/../config/../app/views/recipe/edit.rhtml:87: syntax error,
unexpected kEND, expecting ')'
I can gather it is complaining about some misplaced paranthesis and
'end' statement. However, there is no other enumeration/anonymous code
block in the code other than the one shown above.