Title: Routing resources/paths with :path_prefix and :name_prefix
Tags: ruby-on-rails;routes
Question: I have the following route definied:

```map.resources :addresses, :path_prefix =&gt; ':site', :name_prefix =&gt; 's_'
```

I've had no problem correcting my scaffolding links for "Show" and "New". But I am getting a failure to generate error when attempting to use:

```edit_s_address_path(address) or edit_s_address
```

rake routes shows that this is the proper path. I'm perplexed. Thanks in advance.

Comment: What version of rails is this? and can you show some code where you are trying to ref the route from? (like a snippet of a view or controller)


Here is another answer: Shouldn't you use ```s_edit_address_path(address)```? According to the Rails Guide on routing, the ```name_prefix``` comes at the start of the route name.

Comment for this answer: That's what I thought, too. But I get an undefined method name using the name prefix at the beginning. rake routes shows that 'edit' and 'new' prefix everything.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2009:00:07/07/09', 'FavoriteCount': 0.0, 'PostTypeId': 1, 'Tags': '<ruby-on-rails><routes>', 'Title': 'Routing resources/paths with :path_prefix and :name_prefix', 'ViewCount': 5619, 'id': 1094586, 'user_AboutMe': None, 'user_AccountId': None, 'user_DisplayName': None, 'user_Reputation': None, 'user_Views': None, 'user_id': None}}