# Rendering another action instead of the specified action

**URL:** <https://www.ruby-forum.com/t/rendering-another-action-instead-of-the-specified-action/146404>\
**Category:** Rails\
**Created:** [August 20, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/rendering-another-action-instead-of-the-specified-action/146404 "2008-08-20T17:15:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hema\_mca](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/779978/32.png) [@hema\_mca](https://www.ruby-forum.com/u/hema_mca)\
**Post date:** [August 20, 2008, 5:15pm UTC](https://www.ruby-forum.com/t/rendering-another-action-instead-of-the-specified-action/146404/1 "2008-08-20T17:15:18Z")

</div>

In my view i am using as that is in the new.rhtml  
\<%= link\_to “Show All Elections”,:controller =\> “elections”,:action =\>  
“display” %\>

And in the controller i am using the definition as  
def display  
@elections = Election.find(:all)  
end

I have the display.rhtml page as

\<% for h\_edi\_employee\_election in @h\_edi\_employee\_elections %\>  
\<%= link\_to %Q{#{election.Employee\_Id}}, :action =\> ‘show’, :id =\>  
election %\>  
\<% end %\>

But it is not rendering the display action  
Show is the another action which display only the particular employee…  
i need to display the list so i used the display action  
But when i click the link it is throwing the exception

NoMethodError in Elections#show  
Showing elections/\_form.rhtml where line #104 raised:

why it is rendering the action show? and going for the \_form.rhtml  
page…  
can anyone please help me?  
and i also kept the validations in my model but they are not effecting  
when i am creating the employee.Please Help me regarding these issues…
