# NameError and routing problem

**URL:** <https://www.ruby-forum.com/t/nameerror-and-routing-problem/140494>\
**Category:** Rails\
**Created:** [June 14, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/nameerror-and-routing-problem/140494 "2008-06-14T23:46:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ewo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/8e8cbc/32.png) [@ewo](https://www.ruby-forum.com/u/ewo)\
**Post date:** [June 14, 2008, 11:46pm UTC](https://www.ruby-forum.com/t/nameerror-and-routing-problem/140494/1 "2008-06-14T23:46:14Z")

</div>

I have the following (abridged) routes in routes.rb:

map.namespace :member do |member|  
member.resource :profile, :controller =\> ‘profile’ do |profile|  
profile.edit\_address ‘address/:id/edit’, :action =\>  
‘edit\_address’, :conditions =\> { :method =\> :get }  
end  
end

which nicely creates (among others):

member\_profile\_edit\_address GET /member/profile/address/:id/edit  
{:action=\>“edit\_address”, :controller=\>“member/profile/”}

Unfortunately, when I use this like so:

\<%= link\_to(‘Edit’, member\_profile\_edit\_address(@member.address.id))  
%\>

which generates for example:

[Edit](https://www.ruby-forum.com/member/profile/address/32/edit)

what happens upon clicking the link is:

NameError in Member/profile/Controller#edit\_address  
uninitialized constant Member::Profile

I assume that I have messed up the routes somehow, but it looks right  
to me. Any help will be appreciated…
