I receive this error with my contact form in rails:
First argument in form cannot contain nil or be empty
View:
I had the same problem. I have a Comment model, a CommentsController, a 'show' action and a 'show' view for the comment. I also have a '_show' partial rendered inside the 'show' view with following local:
:locals => {:comment => @comment}
and inside the '_show' partial I have a
<%= form_for(comment, :remote => true) do |f| %>
which troughs the "First argument in form cannot contain nil or be empty". I only could solve the problem by renaming the local:
:locals => {:new_comment => @comment}
and within the partial:
<%= form_for(new_comment, :remote => true) do |f| %>
It seems using the same name for the Model and the partial local caused some conflict for me.