# Adding an action to a ressource

**URL:** <https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019>\
**Category:** Rails\
**Created:** [October 2, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019 "2008-10-02T15:15:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pandabeer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@pandabeer](https://www.ruby-forum.com/u/pandabeer)\
**Post date:** [October 2, 2008, 3:15pm UTC](https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019/1 "2008-10-02T15:15:10Z")

</div>

Hello everybody,

I would like to use a pretty path like new\_article in order to route  
easily on a specific ressource.  
In my case, I had added this new action in my articles controller:

def lock  
#…  
end

And now I would like to use a path such as: lock\_article. But when I do  
this: rake routes, I don’t see this path.

In my routes.rb file, I just have this:  
map.resources :articles

Thanks for any ideas. ENJOY RAILS!!!

---

<div class="post-metadata">

**Author:** ![pandabeer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecd19e/32.png) [@pandabeer](https://www.ruby-forum.com/u/pandabeer)\
**Post date:** [October 3, 2008, 9:46pm UTC](https://www.ruby-forum.com/t/adding-an-action-to-a-ressource/150019/2 "2008-10-03T21:46:22Z")

</div>

Up please.

I don’t know if my answer was well enunciated. Actually I would like to  
be able to use a path like:  
new\_article\_path, edit\_article\_path, article\_path, etc.

But I would like so with lock\_article\_path (in order to focus on lock  
action). And as it is not RESTful, this do not work… I don’t know what  
kind of configuration can solve this trouble.
