[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem in new.rhtml file

Andrea Raimondi

9/25/2006 6:17:00 AM

Hello,

My database is MySQL5 and has this structure:

NAME: gigolo_development

TABLES
------

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

<h1>New service_gigolo</h1>

<%= start_form_tag :action => 'create' %>
<select>
<%for gigolo in @gigolos%>
<option value="<%=gigolo.column(id)%>">
<%gigolo.column(name)%>
</option>
</select>
<%= 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 error

It then says:

Extracted source (around line #12):

10:
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?

TIA,

Andrew
1 Answer

Reprisal

9/25/2006 6:42:00 AM

0

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
http://groups.google.com/group/rubyon... .