Hello
I have an array of tasks which the user needs to fill,
Its looks like this:
<% form_for(@task) do |f| %>
<%= error_messages_for 'task' %>
<ul>
<li><label>Task Name</label> <input type=text name="task_list[]"> </li>
<li><label>Task Name</label> <input type=text name="task_list[]"> </li>
<li><label>Task Name</label> <input type=text name="task_list[]"> </li>
</ul>
<% end %>
Now I need to perform a validation that at list one field is not empty. When it was only one field I used to perform the validation in the model like this:
validates_presence_of :name,:message Task Name cannot be blank
But now when I use an array I don’t know how I can perform it
I will be happy for some guidance in this issue
Thanks