# Custom Actions in Routes.rb

**URL:** <https://www.ruby-forum.com/t/custom-actions-in-routes-rb/130127>\
**Category:** Rails\
**Created:** [February 25, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/custom-actions-in-routes-rb/130127 "2008-02-25T17:08:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![evan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/54ee81/32.png) [@evan](https://www.ruby-forum.com/u/evan)\
**Post date:** [February 25, 2008, 5:08pm UTC](https://www.ruby-forum.com/t/custom-actions-in-routes-rb/130127/1 "2008-02-25T17:08:54Z")

</div>

Hi, on rails 2.0.2 i generate a controller with actions Index and New  
using:  
“script/generate controller Recipe Index New”

I can now access the actions index/new through /recipe/index or /  
recipe/new. But if i create a new blank action called delete using:  
“def delete  
end”

and create the corresponding view for delete action i cannot access it  
through /recipe/delete!

I’ve been told that this is because in restful routes i need to  
specify the new action delete (even though i never specified the  
actions index/new) and i have searched through the api but am still  
not clear on how exactly i would add a custom action route to  
routes.rb?
