Hi all,
I''m new to rails.
I have created a bunch of CRUD code using scaffolds.
I had to add code to the default output to account for
fields that establish the relationships between tables.
Everything works well, including the validation of the
fields I added. However, I can''t get the highlighting
to work for my fields when they fail validation and the
view is redisplayed.
Here is an example snippet from _form.rhtml:
<!--[form:account]-->
<p><label
for="account_number">Number</label><br/>
<%= text_field ''account'', ''number'' %>
<br>
<label for="broker_id">Broker</label><br/>
<select id="broker_id" name="broker_id">
<option value="0">Choose</option>
<% for broker in @brokers %>
<option
value="<%=broker.id%>"><%=broker.name%></option>
<% end %>
</select>
</p>
<!--[eoform:account]-->
I think if I used the select helper it would work, but I
can''t think of a way to inject my "fake" row of "0,
Choose"
as a Broker that forces the user to pick a value from the
dropdown (he legit values are all in the @brokers list).
Any ideas?
-Shane
--
Posted via http://www.ruby-forum.com/.