Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Statuses page does not exist!

I'm not sure what I did but when I try going to 127.0.0.1:3000/statuses I'm getting a "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved." error message. I have no idea what I did so any advice would be really helpful.

7 Answers

Could you share your print out of 'rake routes' command?

Cheers.

profiles_show GET /profiles/show(.:format) profiles#show new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel user_registration POST /users(.:format) devise/registrations#create new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit PUT /users(.:format) devise/registrations#update DELETE /users(.:format) devise/registrations#destroy register GET /register(.:format) devise/registrations#new login GET /login(.:format) devise/sessions#new logout GET /logout(.:format) devise/sessions#destroy GET /:id(.:format) profiles#show statuses GET /statuses(.:format) statuses#index POST /statuses(.:format) statuses#create new_status GET /statuses/new(.:format) statuses#new edit_status GET /statuses/:id/edit(.:format) statuses#edit status GET /statuses/:id(.:format) statuses#show PUT /statuses/:id(.:format) statuses#update DELETE /statuses/:id(.:format) statuses#destroy feed GET /feed(.:format) statuses#index root / statuses#index

profiles_show GET /profiles/show(.:format) profiles#show new_user_session GET /users/sign_in(.:format) devise/sessions#new user_session POST /users/sign_in(.:format) devise/sessions#create destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy user_password POST /users/password(.:format) devise/passwords#create new_user_password GET /users/password/new(.:format) devise/passwords#new edit_user_password GET /users/password/edit(.:format) devise/passwords#edit PUT /users/password(.:format) devise/passwords#update cancel_user_registration GET /users/cancel(.:format) devise/registrations#cancel user_registration POST /users(.:format) devise/registrations#create new_user_registration GET /users/sign_up(.:format) devise/registrations#new edit_user_registration GET /users/edit(.:format) devise/registrations#edit PUT /users(.:format) devise/registrations#update DELETE /users(.:format) devise/registrations#destroy register GET /register(.:format) devise/registrations#new login GET /login(.:format) devise/sessions#new logout GET /logout(.:format) devise/sessions#destroy GET /:id(.:format) profiles#show statuses GET /statuses(.:format) statuses#index POST /statuses(.:format) statuses#create new_status GET /statuses/new(.:format) statuses#new edit_status GET /statuses/:id/edit(.:format) statuses#edit status GET /statuses/:id(.:format) statuses#show PUT /statuses/:id(.:format) statuses#update DELETE /statuses/:id(.:format) statuses#destroy feed GET /feed(.:format) statuses#index root / statuses#index

  • Have you a statuses controller and index action in it?

  • Have you a html file in app/views/statuses/index.html.erb?

Cheers.

Statuses Controller with index action
'''def index @statuses = Status.all

respond_to do |format|
  format.html # index.html.erb
  format.json { render json: @statuses }
end

end'''

And I do have th index.html.erb file in my directory

Everything looks normal. You should be sure that your index.html.erb file must be located in right folder.

its in app/views/statuses/index.html.erb

The page loads fine when I go to 127.0.0.1:3000 but I get the error when I try to go back after successfully submitting or editing a status. I'm using the follow code to link back to my statuses path.

'''<%= link_to 'Back', statuses_path %>'''

The url that it is trying to open is http://127.0.0.1:3000/statuses

it was my '''get '/:id', to: 'profiles#show'''' that was throwing it off!