# Searching a record

**URL:** <https://www.ruby-forum.com/t/searching-a-record/185790>\
**Category:** Rails\
**Created:** [March 26, 2010, 3:44am UTC](https://www.ruby-forum.com/t/searching-a-record/185790 "2010-03-26T03:44:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newnw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/919ad9/32.png) [@newnw](https://www.ruby-forum.com/u/newnw)\
**Post date:** [March 26, 2010, 3:44am UTC](https://www.ruby-forum.com/t/searching-a-record/185790/1 "2010-03-26T03:44:08Z")

</div>

I have a table called project. I want to make a search window to search  
particuler project details when I enter the project name. I have done  
followings.

create a project controller and insert

def search  
@project = Project.find\_by\_name(params[“x”])  
end

then create a view for the searching window as follows( inside project  
directory)

\<% form\_tag(:controller =\> “projcet” , :action =\> “search”) do %\>

\<%= text\_field\_tag “x” %\>  
\<%= submit\_tag %\>  
\<% end %\>

then I create a seacrh.html.rb inside the project directory and insert

\<% if @project.empty? %\>  
No project found  
\<% else %\>  
\<% @project.each do |project| %\>  
\<%= link\_to project.name, project\_url(project)%\>  
  
  
\<% end %\>  
\<% end %\>

then I click the seach button i’m gettin following error

Routing Error

No route matches “/projcet/search” with {:method=\>:post}

I WOULD MUCH APPRECIATE if any one can help me to solve this…

---

<div class="post-metadata">

**Author:** ![newnw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/919ad9/32.png) [@newnw](https://www.ruby-forum.com/u/newnw)\
**Post date:** [March 26, 2010, 4:20am UTC](https://www.ruby-forum.com/t/searching-a-record/185790/2 "2010-03-26T04:20:26Z")

</div>

On Thu, Mar 25, 2010 at 9:44 PM, Nipuna W.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a table called project.

Shouldn’t the table name be plural, “projects” ?

> \<% form\_tag(:controller =\> “projcet” , :action =\> “search”) do %\>

projcet != project ?

> No route matches “/projcet/search” with {:method=\>:post}

–  
Greg D.  
[destiney.com](http://destiney.com) | [gregdonald.com](http://gregdonald.com)

---

<div class="post-metadata">

**Author:** ![newnw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/919ad9/32.png) [@newnw](https://www.ruby-forum.com/u/newnw)\
**Post date:** [March 26, 2010, 4:29am UTC](https://www.ruby-forum.com/t/searching-a-record/185790/3 "2010-03-26T04:29:48Z")

</div>

Hi…

On Fri, 2010-03-26 at 03:44 +0100, Nipuna W. wrote:

> then create a view for the searching window as follows( inside project  
> directory)
> 
> \<% form\_tag(:controller =\> “projcet” , :action =\> “search”) do %\>  
> ---- ^^^^^^^  
> try fixing this typo ^^^^^^^

* * *

> \<% @project.each do |project| %\>
> 
> I WOULD MUCH APPRECIATE if any one can help me to solve this…

* * *

Craig

–  
This message has been scanned for viruses and  
dangerous content by MailScanner, and is  
believed to be clean.

---

<div class="post-metadata">

**Author:** ![newnw](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/919ad9/32.png) [@newnw](https://www.ruby-forum.com/u/newnw)\
**Post date:** [March 26, 2010, 5:20am UTC](https://www.ruby-forum.com/t/searching-a-record/185790/4 "2010-03-26T05:20:43Z")

</div>

Craig W. wrote:

> Hi…
> 
> On Fri, 2010-03-26 at 03:44 +0100, Nipuna W. wrote:
> 
> > then create a view for the searching window as follows( inside project  
> > directory)
> > 
> > \<% form\_tag(:controller =\> “projcet” , :action =\> “search”) do %\>  
> > ---- ^^^^^^^  
> > try fixing this typo ^^^^^^^
> 
> * * *
> 
> > \<% @project.each do |project| %\>
> > 
> > I WOULD MUCH APPRECIATE if any one can help me to solve this…
> 
> * * *
> 
> Craig
> 
> –  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

HI CRAIG and DONALD,

I CHANGED THE CTROLLERNAME TO project but still i’m getting the same  
error.  
PLEASE HELP ME.
