Martin Gamsjaeger
2006-Jun-12 15:45 UTC
[Rails] Realtime form validation for forms containing collections
Hi,
I''m successfully using the realtime_form_validation plugin from
http://railsrtv.rubyforge.org/ However, my forms contain collections,
as described in the AWDWR book. Basically my form looks like this.
2004 2005 2006
Question 1 12 13 15
Question 2 9 11 13
I have the following code to generate ids for my input fields. In my
view and my controller I have realtime_validation setup properly (all
other forms without collections work fine!)
<% @id = 1 %>
<% for @model_name in @model_instance_var %>
<td class="questin"><%=text_field("model_name[]",
''field_name'', :id
=> "modelname[" + @id.to_s + "]_field_name") %>
<% @id += 1 %>
<% end %>
However, this is not working! Any tips on how to get forms containing
collections working with realtime validation? I would really
appreciate any help!
cheers
Martin
