Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:39:52+00:00 2026-06-17T23:39:52+00:00

I am new to rails and this is my first app. Currently using rails

  • 0

I am new to rails and this is my first app. Currently using rails 3.2.11 and devise 2.2.3 for authentication.

The problem is after signing in, the application returns 404 and says that it was not able to find a route for ‘users’ controller and ‘show’ action.

I have a home controller for static pages and a user controller for the user. I have generated the User model using the rails generate command. My config/routes.rb is as below.

devise_for :users
resources  :users
root :to => 'home#index'

Started POST “/users/sign_in” for 127.0.0.1 at 2013-01-29 15:44:25 +0530
Processing by Devise::SessionsController#create as HTML
Parameters: {“utf8″=>”✓”, “authenticity_token”=>”cHXjNbgzEx2YsHX/AMb1oxjStY75IVHc9wT40NUOdJM=”, “user”=>{“email”=>”r@e.com”, “password”=>”[FILTERED]”, “remember_me”=>”0”}, “commit”=>”Sign in”}
User Load (0.4ms) SELECT “users”.* FROM “users” WHERE “users”.”email” = ‘r@e.com’ LIMIT 1
(0.1ms) begin transaction
(0.5ms) UPDATE “users” SET “last_sign_in_at” = ‘2013-01-29 10:06:46.145781’, “current_sign_in_at” = ‘2013-01-29 10:14:26.063767’, “sign_in_count” = 66, “updated_at” = ‘2013-01-29 10:14:26.067024’ WHERE “users”.”id” = 1
(188.0ms) commit transaction
Completed 404 Not Found in 365ms

ActionController::RoutingError (No route matches {:action=>"show", :controller=>"users"}): app/controllers/application_controller.rb:5:in `after_sign_in_path_for'

And I have modified the applications controller as below

def after_sign_in_path_for(resource)
  user_url(resource)
end

What I am trying to do is that once the user logs in, I want to show the user specific information. For that I modified the after_sign_in_path_for(). Any hints on how I can get the desired results?

My rake routes output is below

        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
                   users GET    /users(.:format)               users#index
                         POST   /users(.:format)               users#create
                new_user GET    /users/new(.:format)           users#new
               edit_user GET    /users/:id/edit(.:format)      users#edit
                    user GET    /users/:id(.:format)           users#show
                         PUT    /users/:id(.:format)           users#update
                         DELETE /users/:id(.:format)           users#destroy
                    root        /                              home#index
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:39:54+00:00Added an answer on June 17, 2026 at 11:39 pm

    You need on your application_controller.rb

     def after_sign_in_path_for(resource)
       user_url(current_user)
      end
    

    Take a look at https://github.com/plataformatec/devise/wiki/How-to%3A-redirect-to-a-specific-page-on-successful-sign-in-and-sign-out

    Just try it on a clean installation of rails/devise and working properly. I think you should have some redirection in users_controller.rb and therefore does not work properly!. Please remove any filter or redirect you have in your controllers and test that code

    Give a shot!

    Regards!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using devise in my rails 3.2 application. I have a users/new page where
I'm new to Rails and I'm trying to create an app using devise for
I'm using devise 1.1.RC0 for user authentication in a rails 3.0.0 app. Due to
I'm currently in the process of writing my first Rails app. I'm writing a
I'm new to Ruby on Rails, trying to get my first app working, which
I'm very new to rails and putting together my first app. Please bear with
I started up a completely new Rails and Facebook app and followed this guide
I'm new to rails development so this is a very basic question. I'm working
Please bear in mind that I'm totally new to Rails when answering this.My question
As a preface to this question: I am brand new to Rails development (and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.