title: ruby on rails - First argument in form cannot contain nil or be empty
body: <p>I am geting <strong>ArgumentError in Catagorys#create</strong>
  <strong>First argument in form cannot contain nil or be empty</strong>
  And it happens if i add to model validate</p>
  
  <p>My Catagorys controler</p>
  
  <pre><code>Class CatagorysController &lt; ApplicationController
  layout "admin_login_registration"
  def index
  @Catagorys = Kategorija.all
  end
  
  def new
   @category_new = Kategorija.new
  end
  
    def create
        @new_catagory = Kategorija.new(catagory_params)
  
        if @new_catagory.save
  
          redirect_to catagorys_path
        else
          render action: "new"
        end
        end
  
        def delete
        end
  
        def update
        end
  
        def catagory_params
         params.require(:kategorija).permit(:kategorija , :description)
        end
        end
  </code></pre>
  
  <p>And my new.htm.erb</p>
  
  <pre><code> &lt;%= form_for (@category_new) do |f| %&gt;
    &lt;% if @category_new.errors.any? %&gt;
      &lt;div class="error_messages"&gt;
        &lt;h2&gt;Form is invalid&lt;/h2&gt;
        &lt;ul&gt;
          &lt;% for message in @category_new.errors.full_messages %&gt;
            &lt;li&gt;&lt;%= message %&gt;&lt;/li&gt;
          &lt;% end %&gt;
        &lt;/ul&gt;
      &lt;/div&gt;
    &lt;% end %&gt;
  &lt;p&gt;  Kategorijas nosaukums: &lt;%= f.text_field :kategorija %&gt;&lt;/p&gt;
  &lt;p&gt;  Apraksts:   &lt;%= f.text_area_tag :description, nil,class: "col-lg-2 control-label" %&gt;&lt;/p&gt;
  &lt;p&gt;&lt;%= f.submit "Izveidot kategoriju", class: "login login-submit" %&gt;&lt;/p&gt;
  </code></pre>
  
  
  
  <p>And the last one katagorija model</p>
  
  <pre><code>class Kategorija &lt; ActiveRecord::Base
  validates :kategorija, presence: true
  end
  </code></pre>
  
  <p><strong>How to fix it?</strong></p>