run "rake routes" command to show all possible routes and path/url names
tom
Stephen Fagan wrote:
> 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:
>
> <p>
> <% 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 -%>
> </p>
>
> 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
--
===============================================================================
Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache
www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz
===============================================================================
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---