Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails for Zombie Level 5 Challenge 2 - Custom Routes

The objective is to create a custom route so that /undead will go to the undead action on the ZombiesController.

My code:

TwitterForZombies::Application.routes.draw do
    resources :zombies 
    match 'show_zombie' => "undead#show" 
end

And the error..."Did not add the correct route, could not get to ZombiesController#undead."

I'm not sure where i went wrong....

like image 830
bpark Avatar asked Jan 23 '26 22:01

bpark


1 Answers

Your route notation should look like this:

match 'path' => 'controller#action'

So, the path is undead, the controller is zombies, and the action is undead:

match 'undead' => 'zombies#undead'
like image 96
Ryan Atallah Avatar answered Jan 26 '26 12:01

Ryan Atallah