# Add custom parameters to map.resources

**URL:** <https://www.ruby-forum.com/t/add-custom-parameters-to-map-resources/149404>\
**Category:** Rails\
**Created:** [September 24, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/add-custom-parameters-to-map-resources/149404 "2008-09-24T14:14:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![berlin\_2.0](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/db5fbb/32.png) [@berlin\_2.0](https://www.ruby-forum.com/u/berlin_2.0)\
**Post date:** [September 24, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/add-custom-parameters-to-map-resources/149404/1 "2008-09-24T14:14:37Z")

</div>

Hi,

lets say I defined the following resources:

map.resources :profiles

Is it possible to add a custom parameter just to one action via a  
block in the map.resources statement? I found the following solutions:

map.resources :profiles, :path\_prefix =\> ‘/  
profilecategory/:profilecategory\_id’

Problem here: It applies to every action, but I want it e.q. only for  
the ‘new’ action.

map.profile ‘/profile/:username’, :controller =\> ‘profiles’, :action  
=\> ‘show’

This works for one action, problem here: There still exists the route  
from map.resources to ‘show’, which would be something like ‘/  
profiles/:profile\_id’

Any suggestions?
