Routing a location that matches one controller to another
Posted
by Luca Romagnoli
on Stack Overflow
See other posts from Stack Overflow
or by Luca Romagnoli
Published on 2010-04-15T22:58:04Z
Indexed on
2010/04/15
23:23 UTC
Read the original article
Hit count: 335
routes
|ruby-on-rails
Hi I have a controller named "places" with some actions like "view", "new", "create"
When a user goes to mysite.com/places I want to execute the action "show" of another controller called "cores"
So I've put this in the routes.rb file:
map.connect '/:id/show', :controller => "cores", :action => "show"
But it doesn't work.
I receive this error:
Processing PlacesController#show (for 127.0.0.1 at 2010-04-16 00:52:07) [GET]
ActionController::UnknownAction (No action responded to show. Actions: admin_denied, admin_required, auto_complete_for_location, auto_complete_for_name, change_location, create, create_facebook_session, create_facebook_session_with_secret, edit, exist, facebook_params, facebook_session, facebook_session_expired, facebook_session_parameters, get_form, is_admin?, new, one_or_true, redirect_to, render_publisher_error, render_publisher_interface, render_publisher_response, set_facebook_session, top_redirect_to, update, wants_interface?, and zero_or_false):
How can i do to map that action in another controller?
thanks
© Stack Overflow or respective owner