Can I use the built in validation helpers with an ajax form?
At the moment I get a
"NoMethodError, WARNING: You have a nil object when you probably
didn''t expect it! Odds are you want an instance of Array
instead."
for my ajax action when I put validation in my model. The specfic
problem has to do with this code in my view
<p><label
for="image_category">Category</label><br/>
<select name="image[category_id]">
<% @categories.each do |category| %>
<option value="<%= category.id %>">
<%= category.title %>
</option>
<% end %>
</select></p>
if I remove the select list from my view and retry the form, the
validation works, but it renders the new form again over the existing
layout. If I tell the action to render without a layout, it still
renders my form again over the old one, but without the rest of the
page.
I''ve not read that you need to do anything special to validate an ajax
form, so am I missing something?
Kieran