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

  • SEARCH
  • Home
  • 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 9110755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:20:41+00:00 2026-06-17T03:20:41+00:00

I have started building a simple rails app and have used Devise for authentication.

  • 0

I have started building a simple rails app and have used Devise for authentication. I have created a Dashboard page for the users after they login, it’s using a users_contoller added below:

class UserController < ApplicationController
    before_filter :authenticate_user!

    def show
        @user = User.find(params[:id])
    end
end

I have renamed this user#show to dashboard in routes:

match '/dashboard', to: 'user#show'

I have created a if else statement in the User show html page to see if this works, shown below:

<% if @user.lists.any? %>
    Cool you have lists
<% else %>
    OK No Lists
    <%= @user[:id] %>
<% end %>

Unfortunately this just renders an error when trying to load the page in a browser

 Couldn't find User without an ID

Im not sure if this is simply a Devise setting or something more fundamental and apologies in advance if this is avery noob question.

  • 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-17T03:20:42+00:00Added an answer on June 17, 2026 at 3:20 am

    When a user is autenticated using devise the current autenticated user is “stored” in a helper called “current_user”.

    A quick fix for your problem should be changing the code in your “UserController” to something like this (at the same time mantaning the rest funcionality):

    class UserController < ApplicationController
        before_filter :authenticate_user!
    
        def show
            @user = params[:id].blank? ? current_user : User.find(params[:id])
        end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting into using REST and have started building my first app following
I am building an app to learn Django and have started with a Contact
I just started building an app using X-Code 4.2. I created the app with
I am new to android programming.I have started building an app using eclipse.In the
I have just started building my first Flask app, which currently simply returns output
I have recently started programming in PHP. I am building a cart in PHP.
I have started implementing Subscriptions into my app but I cannot get the API
I'm building a relatively simple web-app where the main servlet implements the ServletContextListener interface
Note: I'm just getting started with Jenkins plugin development and have never used maven
I have started building a system with clojure, mainly because I need to use

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.