which according to 'rake routes' should give me the index method of
the mobile/entries controller. However, the above URL ends up taking
me to the UsersController instead, despite what rake routes is telling
me. The result is that I end up with the "no action responded to 1"
error.
If you'd like to have a look at the app, I've zipped it up and placed
it in this address:
You can also go into the actual site http://tagtheplanet.net/mobile/
and go to Blogs and click on the Admin link at the top to get the same
error, or use the URL
Hi cpaesleme,
Try changing "users.resource :entries" to "users.resources :entries",
then moving the whole map.resources :users block to a line in the
routes.rb file, making sure it appears before the default config
lines:
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
If you plan on supporting both mobile and 'non-mobile' browsers then
you probably want to use namespace in routes:
map.namespace :mobile do |mobile|
mobile.resources :users
end
map.resources :users
This should give you a 'default' routing for 'normal' users (PCs) and
a 'mobile' alternative. You'll have to do the work of determining
which one is appropriate for any given request. The advantage of
using namespacing, though, is that it will automatically look in the /
views/mobile/users folder for the view code.
Thanks for the suggestions. I implemented the namespace, which is
cleaner and leads to less code, and it generates the correct routes
and everything, but still mobile_user_entries_url is redirecting to
the users_controller instead of the entries_controller like rake
routes indicates.
I'll keep poking around the code, let me know if you think of anything
else to try!