# Get member and collection actions of a given controller

**URL:** <https://www.ruby-forum.com/t/get-member-and-collection-actions-of-a-given-controller/172403>\
**Category:** Rails\
**Created:** [July 21, 2009, 2:06am UTC](https://www.ruby-forum.com/t/get-member-and-collection-actions-of-a-given-controller/172403 "2009-07-21T02:06:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esdras\_M](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@Esdras\_M](https://www.ruby-forum.com/u/Esdras_M)\
**Post date:** [July 21, 2009, 2:06am UTC](https://www.ruby-forum.com/t/get-member-and-collection-actions-of-a-given-controller/172403/1 "2009-07-21T02:06:47Z")

</div>

Is there any easy way to do that? In a given controller or resource I  
want  
to get the routes or the actions of the controller, and I want to know  
if  
they are member or collection actions.

When I have an action called search in a controller called posts, and in  
routes.rb I define this action as a collection action like this  
:collection  
=\> {:search =\> :get}, I want to make the following association:

what\_kind\_of\_action?(:search, :posts) than it should return :collection

my english is horrible, my apologies

thanks
