Bolt-network Step 7 cannot view the home page

Hello Guys,
I have modified the route.rb file like this

Rails.application.routes.draw do
get ‘pages#home’ =>‘pages#home’
route ‘pages#home’
route ‘pages#about’

then start view page in step 7 with rails s -p 4001, but nothing happens. Is there any issue to port 4001 or not?

Thanks
Macy

Hi @mhghg,

Could you please give a link to the exercise? I’ll be happy to take a look and see if I can find the problem.

1 Like

Hello zystvan,
Here is the link for my work

https://www.codecademy.com/courses/learn-rails/projects/learn-rails_bolt-network
and my routes.rb file is

Rails.application.routes.draw do
get ‘/pages/home’ =>‘pages#home’
root ‘pages#home’
root ‘pages#about’

Thanks,
Macy

You can only have one root, so remove the root 'pages#about' line, and you’ll need to map /about to pages#about.

1 Like

Hi zystvan,
This is the new file.
Rails.application.routes.draw do
get ‘/pages/home’ =>‘pages#home’
root ‘pages#home’
get ‘/pages/about’ => ‘pages#about’

if i want to go to the about page, I have to type in url this address : https://localhost:4001/pages/home
Am I correct ?

That looks good, just make sure you have an end at the bottom of the file. You can probably also get rid of the /pages/home route since I don’t think it’s used (leave the other pages#home line though).

1 Like

Thanks zystvan!
:yum:

1 Like

This topic is solved.