# Annoying NoMethodError

**URL:** <https://www.ruby-forum.com/t/annoying-nomethoderror/225944>\
**Category:** Rails\
**Created:** [April 4, 2007, 1:37am UTC](https://www.ruby-forum.com/t/annoying-nomethoderror/225944 "2007-04-04T01:37:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![solidariti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/3d9bf3/32.png) [@solidariti](https://www.ruby-forum.com/u/solidariti)\
**Post date:** [April 4, 2007, 1:37am UTC](https://www.ruby-forum.com/t/annoying-nomethoderror/225944/1 "2007-04-04T01:37:27Z")

</div>

Annoying NoMethodError in Admin/project#show when I try to edit and save  
a project and view a project by clicking on \<%= link\_to c.title,  
{:action =\> ‘show’, :id =\> c.id} -%\>

Showing app/views/admin/project/show.rhtml where line #7 raised:  
undefined method `feature’ for #Project:0x31eb290

Extracted source (around line #7):  
4: **Title:** \<%= @project.title %\>  
  
5: **Date Created:** \<%= @project.created\_at %\>  
  
6: **Last updated:** \<%= @project.updated\_at %\>  
7: **Features:** \<%= link\_to @project.feature.name,  
:action =\> “show\_feature”, :id =\> @project.features.id %\>  
  
8:

  
9:  
10: 

\<%= @project.description %\>

heres the show.rhtml:

# \<%= @project.title %\>

**Price:** Â£\<%= @project.price %\>  
**Title:** \<%= @project.title %\>  
**Date Created:** \<%= @project.created\_at %\>  
**Last updated:** \<%= @project.updated\_at %\> **Features:** \<%= link\_to @project.feature.name, :action =\> "show\_feature", :id =\> @project.features.id %\>

\<%= @project.description %\>

* * *

Developer \<%= mail\_to @project.employee\_id -%\>

Designer \<%= mail\_to @project.employee\_id -%\>

\<%= link\_to ‘Back’, {:action =\> ‘list’} %\>

heres the project\_controller.rb:  
def index  
render :action =\> ‘list’  
end

def new  
@project = Project.new  
@features = Feature.find(:all)  
end

def create  
@project = Project.new(params[:project])  
if @project.save  
redirect\_to :action =\> ‘list’  
else  
render :action =\> ‘new’  
end  
end

def list  
@projects = Project.find(:all)  
end

def show  
@project = Project.find(params[:id])  
end

def edit  
@project = Project.find(params[:id])  
@features = Feature.find(:all)  
end

def update  
@project = Project.find(params[:id])  
@features = Feature.find(:all)  
if @project.update\_attributes(params[:project])  
redirect\_to :action =\> ‘show’, :id =\> @project  
else  
render :action =\> ‘edit’  
end  
end

def delete  
Project.find(params[:id]).destroy  
redirect\_to :action =\> ‘list’  
end

def show\_feature  
@feature = Feature.find(params[:id])  
end
