Problem in new.rhtml file


My database is MySQL5 and has this structure:

NAME: gigolo_development


  • Gigolos( id,name,description,photo )
  • Services( id, name, description, quote )
  • Service_Gigolos( id, service_id, gigolo_id )

I’m trying to add a new Service_Gigolo and this is my current
new.rhtml page:

New service_gigolo

<%= start_form_tag :action => ‘create’ %>

<%for gigolo in @gigolos%>


<%= submit_tag “Create” %>
<%= end_form_tag %>

<%= link_to ‘Back’, :action => ‘list’ %>

When trying to use this page, I get the following errors:

  • ./script/…/config/…/app/views/service_gigolos/new.rhtml:12: syntax

It then says:

Extracted source (around line #12):

11: <%= link_to ‘Back’, :action => ‘list’ %>

I’m very new to ruby, so I’m sure I’m not following the
rules, but I’m not sure what I’m getting wrong.

I can add a full trace if you think that would help.

Any hints on what is going on or resources I might look at to
improve my rhtml writing skills?



You’ve forgotten to close your for loop. The error comes after the
last line because thats the last place it was trying to find your <%
end % >.

You’d probably gain some more incite into rhtml on the rails list .