Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Simple Ruby on Rails Application Creating an Authentication System Generating the User Model

Laura Butler
Laura Butler
3,251 Points

Generating the User model- no user/sign_up page

Everything went fine and then when I went to load the user/sign_up page as listed in my command prompt it just redirects to the index/status page. Any ideas on what I should check?

1 Answer

David Ker
David Ker
14,439 Points

Can you post what's in your routes.rb file, and the output when you run rake routes in your terminal?

Laura Butler
Laura Butler
3,251 Points

Hi,

Thanks for helping me out!

Rails.application.routes.draw do devise_for :users resources :statuses root to: 'statuses#index'

# The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes".

# You can have the root of your site routed with "root" # root 'welcome#index'

# Example of regular route: # get 'products/:id' => 'catalog#view'

# Example of named route that can be invoked with purchase_url(id: product.id) # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase

# Example resource route (maps HTTP verbs to controller actions automatically): # resources :products

# Example resource route with options: # resources :products do # member do # get 'short' # post 'toggle' # end # # collection do # get 'sold' # end # end

# Example resource route with sub-resources: # resources :products do # resources :comments, :sales # resource :seller # end

# Example resource route with more complex sub-resources: # resources :products do # resources :comments # resources :sales do # get 'recent', on: :collection # end # end

# Example resource route with concerns: # concern :toggleable do # post 'toggle' # end # resources :posts, concerns: :toggleable # resources :photos, concerns: :toggleable

# Example resource route within a namespace: # namespace :admin do # # Directs /admin/products/* to Admin::ProductsController # # (app/controllers/admin/products_controller.rb) # resources :products # end end


C:\Sites\c3app>rake routes Prefix Verb URI Pattern Controller#Action

    new_user_session GET    /users/sign_in(.:format)       devise/sessions#n

ew user_session POST /users/sign_in(.:format) devise/sessions#c reate destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#d estroy 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 PATCH /users/password(.:format) devise/passwords# update PUT /users/password(.:format) devise/passwords# update cancel_user_registration GET /users/cancel(.:format) devise/registrati ons#cancel user_registration POST /users(.:format) devise/registrati ons#create new_user_registration GET /users/sign_up(.:format) devise/registrati ons#new edit_user_registration GET /users/edit(.:format) devise/registrati ons#edit PATCH /users(.:format) devise/registrati ons#update PUT /users(.:format) devise/registrati ons#update DELETE /users(.:format) devise/registrati ons#destroy 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 PATCH /statuses/:id(.:format) statuses#update PUT /statuses/:id(.:format) statuses#update DELETE /statuses/:id(.:format) statuses#destroy root GET / statuses#index

C:\Sites\c3app>

Laura Butler
Laura Butler
3,251 Points

Started from step one and is working now :)