# Path problem

**URL:** <https://www.ruby-forum.com/t/path-problem/167096>\
**Category:** Rails\
**Created:** [May 3, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/path-problem/167096 "2009-05-03T21:46:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![furrot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/3da27b/32.png) [@furrot](https://www.ruby-forum.com/u/furrot)\
**Post date:** [May 3, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/path-problem/167096/1 "2009-05-03T21:46:48Z")

</div>

Hi all,

I am trying to create a mobile version of my application and for example  
for the mobile forums in routes.rb is:

map.resources :forums,  
:controller =\> ‘mobile/forums’,  
:path\_prefix =\> ‘/mobile’,  
:name\_prefix =\> ‘mobile\_’ do |forums|  
forums.resources :topics,  
:controller =\> ‘mobile/topics’,  
:name\_prefix =\> ‘mobile\_’ do |topics|  
topics.resources :posts,  
:controller =\> ‘mobile/posts’,  
:name\_prefix =\> ‘mobile\_’  
end  
end

In the topics index, to post a topic:

\<% if is\_logged\_in? -%\> \<%= link\_to 'Post New Topic', mobile\_new\_forum\_topic\_path(:forum\_id =\> @forum) -%\> \<% else -%\> \<%= link\_to 'Login to post a new topic', login\_url -%\> \<% end -%\>

The problem is the path mobile\_new\_forum\_topic\_path. I am getting an  
‘undefined method’ error. I know this is because the path is not right  
but I have tried all various combinations e.g. mobile\_new\_topic\_path,  
forum\_mobile\_new\_topic\_path etc but get the same error.

Anyone any ideas?

Thanks

Steve

---

<div class="post-metadata">

**Author:** ![furrot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/3da27b/32.png) [@furrot](https://www.ruby-forum.com/u/furrot)\
**Post date:** [May 7, 2009, 2:13am UTC](https://www.ruby-forum.com/t/path-problem/167096/2 "2009-05-07T02:13:47Z")

</div>

run “rake routes” command to show all possible routes and path/url names

tom

Stephen F. wrote:

> ```
> :controller => 'mobile/topics',
> 
> ```
> 
> \<% if is\_logged\_in? -%\>  
> forum\_mobile\_new\_topic\_path etc but get the same error.
> 
> Anyone any ideas?
> 
> Thanks
> 
> Steve

# –

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

# [www.meinlschmidt.com](http://www.meinlschmidt.com) www.maxwellrender.cz www.lightgems.cz

---

<div class="post-metadata">

**Author:** ![furrot](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/3da27b/32.png) [@furrot](https://www.ruby-forum.com/u/furrot)\
**Post date:** [May 7, 2009, 12:08pm UTC](https://www.ruby-forum.com/t/path-problem/167096/3 "2009-05-07T12:08:40Z")

</div>

I got it sorted out. It turned out to be new\_mobile\_topic\_path. So  
obvious its frightening :@o

Thanks

Steve

Tom Z Meinlschmidt wrote:

> run “rake routes” command to show all possible routes and path/url names
> 
> tom
> 
> Stephen F. wrote:
> 
> > ```
> > :controller => 'mobile/topics',
> > 
> > ```
> > 
> > \<% if is\_logged\_in? -%\>  
> > forum\_mobile\_new\_topic\_path etc but get the same error.
> > 
> > Anyone any ideas?
> > 
> > Thanks
> > 
> > Steve
> 
> ===============================================================================  
> Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
> 
> # [www.meinlschmidt.com](http://www.meinlschmidt.com) www.maxwellrender.cz www.lightgems.cz
