How do you have the create Action route to an alternative model name?
Routes.rb
resources :recovers match ':开发者_StackOverflowcheckedin' => 'recovers#index' match ':checkin/:id' => 'recovers#show'
When a new record is created Rails routes the user to /recovers, I would like the user to be routed to /checkedin how do I do this?
You could do the following:
routes.db:
resources :recovers
match 'checkedin' => 'recovers#index', :as => 'checkedin'
match 'checkin/:id' => 'recovers#show'
recovers_controller.rb: in the create method:
redirect_to checkedin_path
精彩评论