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 trialDevon Latzen
Courses Plus Student 4,356 PointsGenerating the Devise Views: Routing Error
I was following along in this video on creating Devise views. After I entered the code from 1:00-1:55, I refreshed the Treebook page. Instead of showing a new view, it gave me this error:
"Routing Error No route matches [GET] "/" Try running rake routes for more information on available routes."
I have no idea what happened. I couldn't find any errors in what I typed. Here is my code from views/devise/registrations/new.html.erb:
<h2>Sign up</h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :first_name %><br />
<%= f.text_field :first_name %></div>
<div><%= f.label :last_name %><br />
<%= f.text_field :last_name %></div>
<div><%= f.label :profile_name %><br />
<%= f.text_field :profile_name %></div>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
<div><%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %></div>
<div><%= f.submit "Sign up" %></div>
<% end %>
<%= render "devise/shared/links" %>
Just for kicks, here are the first few lines of routes.rb:
Treebook::Application.routes.draw do
devise_for :users
resources :statuses
Any idea what could have gone wrong?
4 Answers
Jason Seifer
Treehouse Guest TeacherTry adding the following to your routes.rb file:
root to: 'statuses#index'
Devon Latzen
Courses Plus Student 4,356 PointsAh, thank you Jason. I just reviewed the video for installing Devise, and saw the place where you gave those instructions. http://bit.ly/xErIWz
Taryn Trueblood
21,798 PointsI did that and I still get the routing error
Taryn Trueblood
21,798 PointsNevermind, I figured out what I did wrong. I typed in the address incorrectly