I have a form that has a lot of fields taken from an array (not from model or object). How can I validate the presence of these fields?
<%= simple_form_for :solve, :url => solve_problem_path do |f| %>
<% @input_variables.each do |label| %>
<%= f.input label %>
<% end %>
...
<% end %>
Create a simple class to wrap the request params and use
ActiveModel::Validations.This gives you the benefit of validating like you would a model, complete with i18n error messages and so on.
EDIT: as per your comment, to validate everything you might do: