# Partial Error

**URL:** <https://www.ruby-forum.com/t/partial-error/189456>\
**Category:** Rails\
**Created:** [June 1, 2010, 10:45am UTC](https://www.ruby-forum.com/t/partial-error/189456 "2010-06-01T10:45:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![badnaam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/e36b37/32.png) [@badnaam](https://www.ruby-forum.com/u/badnaam)\
**Post date:** [June 1, 2010, 10:45am UTC](https://www.ruby-forum.com/t/partial-error/189456/1 "2010-06-01T10:45:47Z")

</div>

I have a home controller and a Search controller.

I would like to include the search form in the content of the home  
controller so I am doing this…

\<%#= render :partial =\> “/searches/form”, :object =\> Search.new, :as  
=\> @search %\>  
\<%= render :partial =\> “/searches/form”, :locals =\> {:search =\>  
Search.new } %\>

The \_form partial looks like this…

\<% semantic\_form\_for @search do |f| %\>  
\<%=  
f.inputs :term, :group\_by, :group\_function, :sort\_by, :sort\_mode,  
:with, :origin%\>  
\<%= f.buttons %\>  
\<% end %\>

when I load the home page I get the following error.

Showing app/views/searches/\_form.html.erb where line #1 raised:  
Called id for nil, which would mistakenly be 4 – if you really wanted  
the id of nil, use object\_id

What am I doing wrong?

Thanks
