Error in validation

I have the following model

class SoftwareCi < ActiveRecord::Base
has_one :ci, :as => :content
has_one :primary_group
validates_presence_of :name, :message => “can’t be empty”

The controller

def create
redirect_to :action => ‘create_ui’


The rhtml, create_ui, I have given the following

<% unless @software_ci.errors.empty? %>
Error occurred!

    <% @software_ci.errors.each_full do |message| %>
  • <%= message %>
  • <% end %>
<% end %>

The problem

I get the following error in the view

You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.errors

Could you please help me?