Path problem


#1

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


#2

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 www.maxwellrender.cz www.lightgems.cz


#3

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 www.maxwellrender.cz www.lightgems.cz